Re: [PHP-DB] last record

2005-01-27 Thread just roibm
> When the result page is presented I want to provide a link to the last > record at the top of the page. well, what about one of these: - add that link via javascript - use some sort of a buffer valiable for the output and add the link at the beginning of the buffer from within php -- PHP Databa

Re: [PHP-DB] last record

2005-01-25 Thread Martin Norland
neil wrote: Thanks Peter The reason I was wanting to do it in php was because the sql query is quite complex and variable depending on the input from a form. When the result page is presented I want to provide a link to the last record at the top of the page. After connecting and selecting the tabl

RE: [PHP-DB] last record

2005-01-24 Thread Peter Lovatt
hi using mysql as you describe is probably the most elegant and efficient way to do it is there a reason for asking php to do it? Peter > -Original Message- > From: neil [mailto:[EMAIL PROTECTED] > Sent: 25 January 2005 03:12 > To: php-db@lists.php.net > Subject: [PHP-DB] last record >

Re: [PHP-DB] last record

2005-01-24 Thread neil
Thanks Peter The reason I was wanting to do it in php was because the sql query is quite complex and variable depending on the input from a form. When the result page is presented I want to provide a link to the last record at the top of the page. After connecting and selecting the table I am co

Re: [PHP-DB] last record

2005-01-24 Thread John Holmes
neil wrote: Apart from the obvious of reversing the sort order in a select statement and then picking off the first record eg. select * from blah where somefield like '%something%' order by someotherfield desc limit 0,1 is there any way in php rather than sql to pick the last record in a record set

RE: [PHP-DB] Last Record

2002-12-09 Thread John W. Holmes
> Is there a quick and easy way to find out the record id of the last record > in > a table? I need to read the last record and let the user know what the > date > of the last record added is. SELECT date FROM table ORDER BY date DESC LIMIT 1 ---John W. Holmes... PHP Architect - A monthly magaz

Re: [PHP-DB] Last record

2002-06-03 Thread César L . Aracena
You can solve that just by asking for the insert_id that was made. Just place the following lines after the mysql_query: $id = mysql_insert_id(); $message = "Record Added (id = $id)"; and you'r done! Cesar Aracena [EMAIL PROTECTED] Neuquen, Argentina - Original Message - From: "Antoni