Re: Update statement?:SOLVED
| From: | Kurth Bemis | Date: | Mon, 30 Apr 2001 17:07:11 +0000 |
| Subject: | Re: Update statement?:SOLVED | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50878@lists.php.net to get a copy of this message | ||
At 01:03 PM 4/30/2001, Steve Werby wrote:
I hate the letter "i" :-)
it was missing when i passed quantity to the function
~kurth
"Kurth Bemis" <kurth@usaexpress.net> wrote: function modify_quantity($table, $session, $itemid, $quantity) { $sql = "UPDATE $table SET quantity='$quantity' WHERE session='$session' AND itemid='$itemid'"; mysql_query("$sql"); Add 'echo $sql;' here (no quotes) and look at the output. If the RHS of quantity= is zero, then $quantity passed to modify_quantity is zero and that's the problem. if there is a value in the db field "quantity" then after the statement is executed it is set to "0" I think that $quantity is the problem. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net