Hi guys,
Hope you can help. I'll give you the source code for my "overwriteProduct.php3" first I think:
<?php
if (count($DBHOST)==0) include("/home/stud/yrf/bsccs4/c9803057/phpincludes/dbFunctions.php3");
$dbcnx = myConnect();
echo "1";
while (list ($key, $value) = each ($PROD_PRICE))
{
echo "3";
$saveQuery = "UPDATE $table_product SET PROD_PRICE = \"$value\" WHERE PROD_ID = \"$key\"";
$result=mysql_query($saveQuery);
echo "4";
if (! $result) printf ("Error: %s<br>", mysql_error ());
};
?>
This gives the following errors when I run the thing:
134Error: You have an error in your SQL syntax near 'SET PROD_PRICE = "222" WHERE PROD_ID = "1"' at line 1
34Error: You have an error in your SQL syntax near 'SET PROD_PRICE = "444" WHERE PROD_ID = "2"' at line 1
34Error: You have an error in your SQL syntax near 'SET PROD_PRICE = "789" WHERE PROD_ID = "3"' at line 1
34Error: You have an error in your SQL syntax near 'SET PROD_PRICE = "321" WHERE PROD_ID = "4"' at line 1
The numbers I'm setting the column/row combos to are spot on ($value & $key are fine). Anyone got an idea why it's not working? The actual query seems to look ok from the error report. The echos are just for checking which query gave an error when I had loads of stuff in there.
I'm using php3, $table_product has values and is fine, as if dbFunctions.php3. I just don't understand where the error is ("near" isn't quite accurate enough for me :-)
Thanks in advance.
Matt Devney
work: c9803057@hud.ac.uk
home: matt@devney.org