Stretch Posted March 21, 2007 Share Posted March 21, 2007 What i want to do is raise the value of "number" in each feild when the script is called in a browser or chron job this doesnt seem to work, in a noob. any help please? <? #connection $sql="select `number`, `id` from table ORDER BY `id` DESC "; $res = mysql_query($sql) or die(mysql_error()); while ($line = mysql_fetch_array($res)); { $turns = $line['turns']; $id = $line['id']; echo $id . '-' . $turns; } ?> Quote Link to comment Share on other sites More sharing options...
AndyB Posted March 21, 2007 Share Posted March 21, 2007 Do you mean you want to increment the value of the field named number in every row of the table? Quote Link to comment Share on other sites More sharing options...
Stretch Posted March 21, 2007 Author Share Posted March 21, 2007 yes, its for a turn based game... i just want, like 100 turns added to the users account every time the script is called. Quote Link to comment Share on other sites More sharing options...
fenway Posted March 21, 2007 Share Posted March 21, 2007 Like UPDATE whateverTable set column = column + 100 WHERE ...? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.