Unable to display more than 25 records

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm using PHP 4.3.10, and MySQL 4.0.26, and cannot seem to get my
script to return/display more than 25 records:

        $query = "SELECT company_name, company_phone FROM tbl_company
                      ORDER BY company_name LIMIT 40 ;";
        $result = mysql_query($query, $db); //note $db connection already
        for ($i=0; $i < $totalRows; $i++)
            $row = mysql_fetch_assoc($result);
            echo "...";// show info here etc.


When I use PHPMyAdmin and run the above SQL statement direct, it
returns all 40 records.  However when running on the host server, my
script is generating and displaying only the first 25 records on my

I'm at a loss here.

Re: Unable to display more than 25 records

Quoted text here. Click to load it

  Where is $totalRows coming from?  You SQL looks fine... so it must be your
FOR...LOOP.  Check the value of $totalRows...

FREE Avatar hosting at www.easyavatar.com

Site Timeline