SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast doubli's Avatar
    Join Date
    Sep 2001
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question about limit

    If I wanted to limit a query so that it started at row 4 and showed all rows in that table whats the way to do that

    I read somewhere LIMIT 4,-1 would do it but it didnt seem to work.

    I know that if I did say LIMIT 4,10 that would show rows 4-10 but I need to show the remainder of the table if possible?
    One of lifes luxuries ...

  2. #2
    purple monkey dishwasher scoates's Avatar
    Join Date
    Nov 2001
    Location
    Montreal
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LIMIT 4,9999999999999999999999999999999999999999999999

    ?

    S

  3. #3
    SitePoint Enthusiast doubli's Avatar
    Join Date
    Sep 2001
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats the only way? ?

    One of lifes luxuries ...

  4. #4
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    well I used

    PHP Code:
    select from mailing_list limit 4,-1
    and it worked for me??

    Version 4.1.1 of php, why do you say it doesn't seem to work?

    I tried it directly in mysqladmin and using php and both worked?

    my php code:

    PHP Code:
    mysql_select_db("leaf_mail"); 
    $sql mysql_query("select * from mailing_list limit 4,-1");
    while (
    $row=mysql_fetch_array($sql)) {
    $id $row["id"];
    $name $row["name"];
    echo (
    "$id$name");

    Regular user

  5. #5
    SitePoint Enthusiast doubli's Avatar
    Join Date
    Sep 2001
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought it was my bad, but I since worked out I cant use LIMIT in a count(*) query

    Heres the thread where i try to explain what i am doing

    http://www.sitepointforums.com/showt...255#post386255
    One of lifes luxuries ...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •