I'm trying to get the max value of a column in a database table.
This is my PHP:
$st = mysql_fetch_assoc(mysql_query("SELECT max(`version`) FROM `remembers` WHERE id='$id'"));
$version = $st['version'] + 1;
So that should get the current version of id
and then update it but adding 1 to it. But $st['version']
seems to be returning 0
when in the database the current highest is 1
Am I doing this wrong? Is there a better way to archive this?