Assuming soldQty is a number and not a string:

"UPDATE products SET soldqty=soldqty+$sqty WHERE
articelno='$articleno'";

If ArticleNo is a number you might want to remove the quotes there too.

=C=
*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-----Original Message-----
From: Jan Grafström [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 1:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Can mysql add qty directly?


Hi!
I have a product table and want to update the qty.
$insert = "UPDATE products SET soldqty='$sqty' WHERE
articelno='$articleno'";
$result = @mysql_query ($insert);
I want the code to automatically add $sqty to soldqty and not overwrite it
like I do above.

Do I need to first make a separate query on soldqty or is there an easyer
way?

Thanks in advance.
--
Regards,
Jan Grafström

Härnösand
Sweden


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to