Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 24th, 2004, 08:14 AM
Registered User
 
Join Date: Nov 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple pages

Hi Matt
Thanks for your help, I have successfully joined my tables! The error came from putting the LIMIT in single quotes rather than Double.

One further question if you dont mind:

I have used the following code

$start = $_GET['start'];
$end = 4 + $start;
$Query = "SELECT * FROM VehicleStock LEFT JOIN cpg11d_pictures ON VehicleStock.RegNo = cpg11d_pictures.title LIMIT $start,$end";

to LIMIT the number of pictures per page, starting the page as Display.php?start=0

The problem I have is that the 1st page is fine with 4 pictures, however page 2 now has 7 pictures and not 4, with page 3 having 3 pictures. This gives a total of 14 pictures when I only started with 11 !!!! How can I restrict each page to just 4 pictures?

website page should it help is:

http://www.usedcars.gb.com/Display.php?start=0

I really am appreciating your assitance

Regards

Bruce


 
Old November 24th, 2004, 12:31 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
Default

hi usedcarsgbcom
As I can see you want to put the limit for outputing mysql result so check this code. maybe it shoud work for you:
$page = $_GET['page'];
$limit = 5;
$start = ($page - 1) * $limit;
$query = mysql_query("SELECT * FROM table WHERE LIMIT $start, $limit");

Regards
Mani_he






Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Pages Report aranjan Crystal Reports 0 January 10th, 2007 01:29 PM
Printing Multiple Pages raja.tadi VB How-To 0 June 26th, 2006 05:19 PM
Printing multiple pages at a go leo_vinay ASP.NET 1.0 and 1.1 Professional 0 November 3rd, 2005 07:22 AM
Multiple pages draganmit BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 2 May 23rd, 2004 12:12 PM
Multiple pages draganmit VB.NET 2002/2003 Basics 0 April 18th, 2004 09:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.