Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 24th, 2004, 08:14 AM
Registered User
 
Join Date: Nov 2004
Location: , , United Kingdom.
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


Reply With Quote
  #2 (permalink)  
Old November 24th, 2004, 12:31 PM
Friend of Wrox
 
Join Date: Aug 2004
Location: , , .
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:22 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.