> 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
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
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
>
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
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
> 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
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