Web Analytics Made Easy -
StatCounter Select Data into blocks - CodingForum

Announcement

Collapse
No announcement yet.

Select Data into blocks

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Select Data into blocks

    Hi there ... i am trying to find out how i can select blocks blocks of data from a select query.
    Let me explain it with an example.......
    We have about 1000 rows in a table.....
    We want each time to print the 1000 rows ordered by time, but only 25 rows for each time. We also need to produce the dynamic the number of url in order to see the next 25 records.
    the first page shows 1....25 record
    if we click to the next 25records url(produced dynamicaly) then
    we can view the 25..50 records
    if we click to the next 25records url(produced dynamicaly) then
    we can view the 51..75 records
    and so on

  • #2
    you want something like this

    $start = $_GET['start_num'];

    $blah = mysql_query("SELECT * FROM bleh LIMIT '$start' , 25");
    while($foo = mysql_fetch_array($blah)){
    echo $foo;
    }

    echo '<a href="page.php?start_num='.$start + 25.'">next</a>';

    hope this helps
    php & asp tutorials - the birthplace - biorust - photoshop and web technologies

    Comment

    Working...
    X