Unable to display more than 25 records
am 11.05.2006 01:58:14 von cspano
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
established
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
website.
I'm at a loss here.
Re: Unable to display more than 25 records
am 13.05.2006 13:04:25 von Norman Peelman
wrote in message
news:1147305494.612659.59370@v46g2000cwv.googlegroups.com...
> 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
> established
> 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
> website.
>
> I'm at a loss here.
>
Where is $totalRows coming from? You SQL looks fine... so it must be your
FOR...LOOP. Check the value of $totalRows...
Norm
---
FREE Avatar hosting at www.easyavatar.com