RE: [PHP] Best way to increment an integer column in mysql

2003-12-11 Thread Rich Gray
I was wondering if there is a php / mysql function call that will increment an integer column in a database. ie. the equivalent to $foo++; Hi John Well you can specify the column as auto_increment to let MySQL handle the incrementation else I suppose - mysql_query('update mytable set

Re: [PHP] Best way to increment an integer column in mysql

2003-12-11 Thread Terence
There's an autoincrement feature for mysql colums, why don't you consider that? CREATE TABLE auto_increment (id INT (4) NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), UNIQUE(id), INDEX(id)) - Original Message - From: John Clegg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday,

Re: [PHP] Best way to increment an integer column in mysql

2003-12-11 Thread David T-G
John - ...and then John Clegg said... % % I was wondering if there is a php / mysql function call that will % increment an integer column in a database. % ie. the equivalent to %$foo++; I didn't see that, but you can at least let mysql do the math: update tablename set field = field + 1