Demonic Posted August 25, 2006 Share Posted August 25, 2006 alright im making this simple shop type deal but i need a lil help.Objective: I want users to buy items and i can set a ammount of number items in stock. Now Say i make a system where users can click on a item and it subtracts the number of items from the usershop.(heres the question) Instead of adding to the ammount giving how can i subtract from it? Well could i do this(assume i connected to database etc..):[code=php:0]$blah = mysql_fetch_array($my_array_idefined);$bam = $blah['points']-1;mysql_query("UPDATE upoints SET points='$bam' where id='1' ");[/code]would that work? anybody got an idea of where im going with this? Thanks in advanced Link to comment https://forums.phpfreaks.com/topic/18670-quick-question/ Share on other sites More sharing options...
dark dude Posted August 25, 2006 Share Posted August 25, 2006 I see nothing wrong with that code, it should do exactly what you explained it should do ;) Link to comment https://forums.phpfreaks.com/topic/18670-quick-question/#findComment-80485 Share on other sites More sharing options...
Demonic Posted August 25, 2006 Author Share Posted August 25, 2006 woot woot :) im a psychic thanks for making sure I Did that right. Link to comment https://forums.phpfreaks.com/topic/18670-quick-question/#findComment-80489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.