FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


how make number pages?





roee
how make number pages?

i dont know how to do it


thanks
Stubru Freak
Roee wrote:
how make number pages?

i dont know how to do it


thanks


What is a number page?
Rhysige
Are you reffering to something similar to forums where it shows a certain number of topics then goes to another page? or are you refferring to the adress being index.php?page=3
Ducksteina
This should do it for you:

Code:
<?php
    $sql = "SELECT * FROM news LIMIT 0,5"; // reads the first 5 results
    $sql = "SELECT * FROM news LIMIT 5,2"; // reads the result 6, 7
    $sql = "SELECT * FROM news LIMIT 10,1"; // reads the result 10
    // etc...
?>
moejoe
I'm not sure...
But would this be valid?

Code:
$sql = "SELECT * FROM news LIMIT 10, 20"; // Reads 10-20


Or would it be LIMIT 10, 10?
BlackSkad
moejoe wrote:
I'm not sure...
But would this be valid?

Code:
$sql = "SELECT * FROM news LIMIT 10, 20"; // Reads 10-20


Or would it be LIMIT 10, 10?


You're sql reeds from 10 to 30. To read from 10 to 20, it's indeed LIMIT 10, 10.
The first number is the index to start from, the second is the number of results you want.
Related topics
Gates: 'Information overload' is overblown
How Spyware Works!!!
SnowScript
Custom error pages using .htaccess
W00t! Something that finally fixes IE.
Page within a page...
500,000 posts
Hepl with Cpanel, checking number of visitors?
Displaying fixed number of records /page
WP kPicasa gallery pages number also up?
[SOLVED] "Dynamic" Pages that sort MySQL data
Site banned from google?
seo tip
Rotate Pages of PDF
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.