CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Last 4 records

Print topic Send  topic

Author Message
RipCurl
Posted: 03/28/2003, 10:35 PM


I have a variable to a page, and a grid that is supposed to display that last four/five , but i can't figure out the query for it. I was thinking of using LIMIT=4 , but dont know how to incorporate it.

CC with pHP and templates
Karen
Posted: 03/29/2003, 1:21 AM

You should have a date or id to order the records by and then use custom sql, e.g.,
select * from table
order by date
limit 4

Hope this helps!
RipCurl
Posted: 03/31/2003, 1:00 PM


What if it want it to display the last 4 records after passing a variable.

As it is right now, Im passing information from a link to show a in a grid, the items for only that variable.

Ie show the last for records where seriesid=#
ripcurl
Posted: 03/31/2003, 5:05 PM

got it figured out.
Mark
Posted: 03/31/2003, 6:10 PM

RipCurl,

then please share yoy solution with the less knowladgeable ...

That is what this forum is all about!
ripCurl
Posted: 04/01/2003, 11:24 AM

Simple actually once i went to mysql's and php.net website and looked up SELECT and LIMIT:


SELECT * FROM {table} ORDER BY {name} DESC LIMIT 4

The "grid" already has the "transfer information" from the preceding link.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.