Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 04-21-2009, 11:39 AM php links
Knight13's Avatar
Defies a Status

Posts: 10,289
Name: Knight13
Location: Cleveland, Ohio
Trades: 0
Sorry i do not know how to word this but hopefully you guys will understand.

I am building a database with movies in it, now i have a page called movies, on the page is a listing of all the movies but their is 50 movie listings on the page and i only want 20 movies per page and i was wondering if their was any way i could make a link that shows the next 20 movies on the same page when i click the link. like how google shows 10 links then when you click the 2 link it takes you to 10 more links like that.

If you don't understand what i am saying please tell me and i will try to reword it.
Knight13 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-21-2009, 12:07 PM Re: php links
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
I think I know what you mean (In future, post code...it's worth 1000 words).

If your using SQL to pull the movies, just adjust the query.

For example, make your query:
Code:
SELECT * FROM `movies` LIMIT 0,20;
For the first page and the following for the second page
Code:
SELECT * FROM `movies` LIMIT 20,40;
and so on.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 04-21-2009, 01:02 PM Re: php links
Knight13's Avatar
Defies a Status

Posts: 10,289
Name: Knight13
Location: Cleveland, Ohio
Trades: 0
I would have submitted code but i do not have any for this other than the query to show the movies on the page. Also wouldent i have to make a new page for every 10 movies i inserted into my database? is their any way to use only one page and every time i click on the link for the next 10 they would show up on the same page?
Knight13 is offline
Reply With Quote
View Public Profile
 
Old 04-22-2009, 01:01 AM Re: php links
nayes84's Avatar
Extreme Talker

Latest Blog Post:
Difference between ASP And JSP
Posts: 232
Name: John
Location: Tokyo
Trades: 0
yes you can use the same page of course.
just use page parameters like

page.php?p=0
and
page.php?p=1
and so on

then in the code you can check on this like the following
PHP Code:
$rows=10;
$start=$_GET["p"]*$rows;
$end=($_GET["p"]+1)*$rows;

$ors=mysql_query("select * from movie limit $start,$end"); 
of course you need ot loop through $ors and display the result
i assume you know that
Quote:
Originally Posted by Knight13 View Post
I would have submitted code but i do not have any for this other than the query to show the movies on the page. Also wouldent i have to make a new page for every 10 movies i inserted into my database? is their any way to use only one page and every time i click on the link for the next 10 they would show up on the same page?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

if(I'm("Helpful")) Add_Talkupation("nayes84");
nayes84 is offline
Reply With Quote
View Public Profile
 
Old 04-23-2009, 05:31 AM Re: php links
Knight13's Avatar
Defies a Status

Posts: 10,289
Name: Knight13
Location: Cleveland, Ohio
Trades: 0
Thanks that is what i was looking for.
Knight13 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to php links
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.66382 seconds with 12 queries