MySQL Forums
Forum List  »  Newbie

updating DB isn't work
Posted by: Oliver Witney
Date: June 17, 2005 09:47AM

ok i have this:

<input name='unlock' type='hidden' value='$Cons[lvl_unlock]'>
<input name='cost1' type='hidden' value='$Cons[c1]'>
<input name='cost2' type='hidden' value='$Cons[c2]'>
<input name='cost3' type='hidden' value='$Cons[c3]'>
<input type='submit' name='Submit' value='Build'>

and then this:

mysql_query("UPDATE accounts SET cons_lvl='$_POST[unlock]' WHERE id='$_SESSION[id]'");
mysql_query("UPDATE accounts SET $r1= (''.$r1.' - '.$_POST[cost1].'') WHERE id='$_SESSION[id]'");
mysql_query("UPDATE accounts SET $r2 = ('$r2' - '$_POST[cost2]') WHERE id='$_SESSION[id]'");
mysql_query("UPDATE accounts SET '$r3' - '$_POST[cost3]' WHERE id='$_SESSION[id]'");

the first 1 works, yet the other 3 don't. i have them the ones that don't work all different because I was playing around with them to see it anything would work, it doesn't.
the last 3 are to set r1 to equal whatever r1 orignally was - cost 1

anyhelp would do thanks :)

Lokolo

Options: ReplyQuote


Subject
Written By
Posted
updating DB isn't work
June 17, 2005 09:47AM
June 17, 2005 09:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.