RE: [PHP-WIN] Getting last id from database

2002-10-03 Thread Rich Gray
why not select id from poll order by id desc limit 1 HTH Rich -Original Message- From: Davy Obdam [mailto:[EMAIL PROTECTED]] Sent: 03 October 2002 16:58 To: Php-Windows Mailing Subject: [PHP-WIN] Getting last id from database Hiya people,.. I have a script and i need to get the

Re: [PHP-WIN] Getting last id from database

2002-10-03 Thread Mihail Bota
Davy, maybe you can try something like "select max(id) as maxid from poll". Mihai On Thu, 3 Oct 2002, Davy Obdam wrote: > Hiya people,.. > > I have a script and i need to get the last id from the database. I have > to get this id to determine whats the latest poll and display that poll > on th

[PHP-WIN] Getting last id from database

2002-10-03 Thread Davy Obdam
Hiya people,.. I have a script and i need to get the last id from the database. I have to get this id to determine whats the latest poll and display that poll on the page. Now i use this: if(!$poll) { $select = mysql_query("SELECT id FROM poll"); $poll = mysql_num_rows($select); } Well everyt