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
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
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?
Thanks
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
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
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
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.
--
Jim
Freedom is worth protecting
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit:
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 magazine
If I have just inserted one set of values with mysql_query(INSERT ...) how
can I get the values just inserted (I needed to get an autoincrement value
out of the table)
Thanks
Antonio Bernabei
- Original Message -
From: César L. Aracena [EMAIL PROTECTED]
To: PHP DB List [EMAIL PROTECTED]
Bernabei [EMAIL PROTECTED]
To: César L. Aracena [EMAIL PROTECTED]; PHP DB List
[EMAIL PROTECTED]
Sent: Monday, June 03, 2002 5:14 AM
Subject: [PHP-DB] Last record
If I have just inserted one set of values with mysql_query(INSERT ...) how
can I get the values just inserted (I needed to get
10 matches
Mail list logo