I'm trying to retrieve the id of one table A to insert into another table B. I cannot use last_insert_id() as i have not inserted anything into A. Any ideas on how to do this nicely?
$n = mysql_query("SELECT max(id) FROM tablename");
doesn't seem to work, nor does
$n = mysql_query("SELECT max(id) FROM tablename GROUP BY id");
DESC TABLE_A
, replacing "TABLE_A" with the name of the table you're wanting to get the latest ID value from. – Overmantel