Jump to content

PHP Causing Internal Server Error


Canman2005

Recommended Posts

Hi all

 

I have something wierd happening.

 

I have a standard QUERY

 

SELECT * FROM `users` WHERE `live` = '0' ORDER BY `fname` ASC

 

but this seems to cause my page an Internal Server Error

 

If I adjust that QUERY to

 

SELECT * FROM `users` WHERE `live` = '0' ORDER BY `fname` ASC LIMIT 980

 

then it runs the page fine and no Internal Server Error

 

DOes anyone know why this might be happening?

 

THanks in advance

 

Dave

Link to comment
https://forums.phpfreaks.com/topic/170815-php-causing-internal-server-error/
Share on other sites

The code is

 

$sql = "SELECT * FROM `users` WHERE `live` = '0' ORDER BY `fname` ASC";
$show = @mysql_query($sql, $connection) or die(mysql_error());
while ($row = mysql_fetch_array($show))
{
}

 

There is around 1,800 records and I load that much data on one page as I need it for a report im doing.

 

Do you think its just overloading the server?

 

I was simply doing a LIMIT to see if I could find the point at where there is an issue and then I may have been able to nail it down to a particular record in the database

Hi

 

Not sure it would overload it on its own, but would probably depend on the data (one reason to avoid SELECT *). Eg, if you are storing a high res image of each user in the users table then it will take a massive amount of space and is also unlikely to be of any use for a report.

 

All the best

 

Keith

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.