Jump to content

[SOLVED] getting the value of a field


me1000

Recommended Posts

hia,

 

So I have a column in a database called ID which is set to auto-increment

so when I add a new entry to the database the number is one larger than the previous entry.

 

is there an easier way than this

$query = "SELECT ID FROM table ORDER DESC LIMIT 1";
$page_id = mysql_fetch_array(mysql_query($query));

to get the value of ID in the last entry?

 

Link to comment
https://forums.phpfreaks.com/topic/59028-solved-getting-the-value-of-a-field/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.