Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP and MySQL quantity updating

Status
Not open for further replies.

mayakovski

Programmer
Jun 21, 2000
4
0
0
CA
Hello;<br>I'm new to PHP and MySQL but fumbling through it.&nbsp;&nbsp;I have a question though.&nbsp;&nbsp;I am putting together an online store using PHP4 and MySQL, but I am having trouble in figuring out how to update inventory quantities in the database.<br>I have looked at a number of PHP4 database scripts and non of them use a product quantity in the database that gets adjusted as users add to there carts.&nbsp;&nbsp;Any thoughts on how I can do this?&nbsp;&nbsp;I want the database to automatically be updated when products are purchased.
 
I gues you must use something like:<br><FONT FACE=monospace><br>$retcode = mysql( $database, &quot;UPDATE invent SET quant=quant+something WHERE condition&quot;, $conex );<br></font><br><br>I hope it works...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top