Moderators: macek, egami, gesf

$inserted_id = mysql_insert_id($query_result);
Xerpher wrote:How would be the best way to fetch the last row in a MySQL table?
DoppyNL wrote:.....
mysql doesn't sort the table by itself, so getting the last record from it is almost completely random.
Greetz Daan
if there is no "ORDER" condition in query, mysql returns recordset in order it stored in database. So:

serge wrote:DoppyNL wrote:.....
mysql doesn't sort the table by itself, so getting the last record from it is almost completely random.
Greetz Daan
if there is no "ORDER" condition in query, mysql returns recordset in order it stored in database.
DoppyNL wrote:serge wrote:DoppyNL wrote:.....
mysql doesn't sort the table by itself, so getting the last record from it is almost completely random.
Greetz Daan
if there is no "ORDER" condition in query, mysql returns recordset in order it stored in database.
mysql DOES NOT return the recordset the way it was entered in the database!!!!
when you haven't deleted any records you may get what you expect, but when you deleted some rows and/or are working with records of a variable length and insert some after that you WILL get some other order wich is NOT the order you entered the records!!
Greetz Daan
How would be the best way to fetch the last row in a MySQL table?


Users browsing this forum: No registered users and 1 guest