RE: [PHP] Can mysql add qty directly?
| From: | Cal Evans | Date: | Thu, 28 Feb 2002 12:50:07 +0000 |
| Subject: | RE: [PHP] Can mysql add qty directly? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-86591@lists.php.net to get a copy of this message | ||
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:jan@grafstrom.net]
Sent: Thursday, February 28, 2002 1:05 AM
To: php-general@lists.php.net
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