Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > PHP and MySQL

Reply
Thread Tools

PHP and MySQL

 
 
Colin Roosendaal
Guest
Posts: n/a
 
      10-30-2005
Hello,

Can someone tell me how to do the following:

I'm looking for the PHP/MySQL query to get the last 5 added records from my
database/table.

For your info

DB name: news
table name: messages

I hope you can help me.

Thanks,

Colin Roosendaal


 
Reply With Quote
 
 
 
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      10-30-2005
Colin Roosendaal wrote:

> Hello,
>
> Can someone tell me how to do the following:
>
> I'm looking for the PHP/MySQL query to get the last 5 added records from my
> database/table.
>
> For your info
>
> DB name: news
> table name: messages


See this page; will probably give you ideas:
<http://www.gossamer-threads.com/forum/General_C8/Databases_and_SQL_F36/sql_query_to_select_last_5_entries_P254072/>

--
-bts
-Warning: I brake for lawn deer
 
Reply With Quote
 
 
 
 
JDS
Guest
Posts: n/a
 
      10-31-2005
On Sun, 30 Oct 2005 18:49:28 +0100, Colin Roosendaal wrote:

> I'm looking for the PHP/MySQL query to get the last 5 added records from
> my database/table.


It depends on how "last five records" is defined.

Is there a date field in the database?
Is there a numeric, auto-incremented ID field?

In other words, is there any field which can be used to track what field
was most recently added?

Is "most recently added" the ones you want? Or do you just want the bottom
five rows after a particular ORDER BY clause has been applied?

Also, this is *really* not an HTML question. Try alt.php or alt.php.sql
or comp.lang.php or other closer-to-on-topic group for more help.

--
JDS | http://www.velocityreviews.com/forums/(E-Mail Removed)lid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP MySQL Web Development - Why Do You Need a PHP & MySQL ... neha shena Python 1 10-29-2010 04:54 AM
FREE SEMINAR on PHP Web Development in Lahore, It covers PHP, MySQL,AJAX & Zend Certification EVS MCSE 0 08-08-2010 12:41 PM
FREE SEMINAR on PHP Web Development in Lahore and Rawalpindi, Itcovers PHP, MySQL, AJAX & Zend Certification EVS MCSE 0 05-31-2010 01:13 PM
PHP Training Institute In Delhi, Live Projects on PHP. Short TermPHP Courses, PHP Scripts, PHP Training with Live Projects. Rajive Narain Java 0 09-18-2009 10:47 AM



Advertisments