Hi,

Try

$saveQuery = "UPDATE $table_product SET PROD_PRICE =
 '$value' WHERE PROD_ID = '$key'";

instead of

$saveQuery = "UPDATE $table_product SET PROD_PRICE =
\"$value\" WHERE PROD_ID = \"$key\"";

Jocelyn Fournier
Presence-PC
www.presence-pc.com


Dans un e-mail daté du 14/05/2001 01:37:19 Paris, Madrid (heure d'été), 
[EMAIL PROTECTED] a écrit :


> Sujet :MySQL-php UPDATE errors
> Date :14/05/2001 01:37:19 Paris, Madrid (heure d'été)
> From:    [EMAIL PROTECTED] (M.G. Devney C9803057)
> To:    [EMAIL PROTECTED] ('[EMAIL PROTECTED]')
> 
> 
> 
> 
> 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
> ", 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?
> 
> Thanks in advance.
> 
> Matt Devney
> work: [EMAIL PROTECTED]
> home: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 
> 
> ----------------------- Headers --------------------------------
> Return-Path: <[EMAIL PROTECTED]>
> Received: from  rly-za03.mx.aol.com (rly-za03.mail.aol.com [172.31.36.99]) 
> by air-za05.mail.aol.com (v77_r1.36) with ESMTP; Sun, 13 May 2001 19:37:19 
> 2000
> Received: from  web.mysql.com (web.mysql.com [192.58.197.162]) by 
> rly-za03.mx.aol.com (v77_r1.36) with ESMTP; Sun, 13 May 2001 19:37:06 -0400
> Received: (qmail 21831 invoked by uid 7797); 13 May 2001 23:32:07 -0000
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm 
> (http://www.ezmlm.org)
> List-ID: <mysql.mysql.com>
> Precedence: bulk
> List-Help: <mailto:[EMAIL PROTECTED]>
> List-Unsubscribe: <mailto:[EMAIL PROTECTED]
> >
> List-Post: <mailto:[EMAIL PROTECTED]>
> List-Subscribe: <mailto:[EMAIL PROTECTED]>
> Delivered-To: mailing list [EMAIL PROTECTED]
> Received: (qmail 21816 invoked from network); 13 May 2001 23:32:05 -0000
> Message-ID: <[EMAIL PROTECTED]>
> From: "M.G. Devney C9803057" <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: MySQL-php UPDATE errors
> Date: Mon, 14 May 2001 00:34:01 +0100
> MIME-Version: 1.0
> X-Mailer: Internet Mail Service (5.5.2650.21)
> Content-Type: text/plain
> 
> 
> 


Reply via email to