Jump to content

[SOLVED] Getting first and last ID's


Canman2005

Recommended Posts

Hi all

 

I have the following QUERY

 

$sql = "SELECT * FROM content ORDER BY id ASC";
$show = @mysql_query($sql,$connection) or die(mysql_error());
while ($row = mysql_fetch_array($show))
{
print $row['id'].'<br>';
}

 

Is it possible to grab the ID of the first row in the table and the last row in the table?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/151376-solved-getting-first-and-last-ids/
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.