beennn Posted September 27, 2011 Share Posted September 27, 2011 whats the simplest way to increase a int in a database? Link to comment Share on other sites More sharing options...
Ingolme Posted September 27, 2011 Share Posted September 27, 2011 Do you mean to increase the number in one record or to increase an ID for a new record?To increase the value in a record: UPDATE table SET field1 = field1 + 1 WHERE field2 = 'value' If you want to increase the value for each record, create a table with AUTO_INCREMENT. Link to comment Share on other sites More sharing options...
beennn Posted September 27, 2011 Author Share Posted September 27, 2011 sorry for not explaining very well, i mean if you were to click a button on your webpage, what would be the easiest way to make that button increase a value in a database? Link to comment Share on other sites More sharing options...
Ingolme Posted September 27, 2011 Share Posted September 27, 2011 Well, the query I showed you will do that. If you have a database, I'm sure you know how to connect and send queries to it, and that you have an understanding of SQL syntax. Link to comment Share on other sites More sharing options...
beennn Posted September 27, 2011 Author Share Posted September 27, 2011 thank you, and mmm lol, haven't done much web work for a few months but ill give it a go =p thanks. edit: all done, thank you for your help Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.