unknown update error :/
Posted: Fri Oct 04, 2002 7:05 am
can anyone see the error in this script? i cant
the output is this:

Code: Select all
<?php
$result = mysql_query("SELECT or1, --------- or40 FROM Players WHERE user='{$HTTP_SESSION_VARSї'user']}'");
$orderrow = mysql_fetch_row($result);
print_r($orderrow);
echo '<br>';
print_r($HTTP_POST_VARS);
if($HTTP_POST_VARSї'ref1a']){
$string1 = $HTTP_POST_VARSї'order1'] . ',' . $HTTP_POST_VARSї'ref1a'];
if($HTTP_POST_VARSї'ref1b']){
$string1 = $string1 . ',' . $HTTP_POST_VARSї'ref1b'];
if($HTTP_POST_VARSї'ref1c']){
$string1 = $string1 . ',' . $HTTP_POST_VARSї'ref1c'];
if($HTTP_POST_VARSї'ref1d'])
$string1 = $string1 . ',' . $HTTP_POST_VARSї'ref1d'];
}
}
echo "string1 = $string1";
$i = 0;
while($i<40){
if(!isset($orderrowї'$i'])){
$i++;
$stringa = 'or'.$i;
echo "stringa = $stringa";
$query = '"UPDATE Players SET ' . $stringa . ' = ''' . $string1 . "' WHERE user= '{$HTTP_SESSION_VARSї'user']}'"";
echo $query;
mysql_query($query);
break;
}
else
$i++;
}
}
?>the output is as expected, but the script itself isnt executing the update (i checked the database) any help would be appreciatedArray ( [0] => ------ [39] => )
Array ( [order1] => 1 [ref1a] => 1 [ref1b] => 4 [ref1c] => [ref1d] => ) string1 = 1,1,4 stringa = or1 "UPDATE Players SET or1 = '1,1,4' WHERE user= 'Jim'"