Jump to content


Photo

quick question :)


  • Please log in to reply
2 replies to this topic

#1 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 25 August 2006 - 08:58 PM

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..):

$blah = mysql_fetch_array($my_array_idefined);
$bam = $blah['points']-1;
mysql_query("UPDATE upoints SET points='$bam' where id='1' ");

would that work? anybody got an idea of where im going with this? Thanks in advanced

#2 dark dude

dark dude
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts

Posted 25 August 2006 - 09:39 PM

I see nothing wrong with that code, it should do exactly what you explained it should do ;)

#3 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 25 August 2006 - 09:48 PM

woot woot :) im a psychic thanks for making sure I Did that right.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users