I have shared hosting with two different hosting providers.
I have the smallest DB query ever (no stress)
all I do is simply echo out some info from a table, nothing crazy:
$loop_query = "SELECT * FROM my_table";
$sl = mysql_query($loop_query, $db_connect);
while ($db = mysql_fetch_array($sl)){
echo $db['name'], $db["age"];}
Now I test this on Server A, everything works fine.
But on Server B, it fails.
I either get a blank page or i get a browser error: connection closed by remote server.
Now I have a few other pages on server B which involve DB queries, and they work fine.
I’m completely lost.
Any help would be much appreciated.
Things to check:
Stray weird characters in your file on the server that’s not working. I’ve seen this happen before, and it’s hard to debug.
Check your shared host’s error log file – should be available in the cpanel.
Check for error logs in the web site folder (or immediately above it).
put an echo after the mysql_query function call, and before the while loop. Try using an echo mysql_error to see if there are any errors.
If you find things in log files, please come back and update your question.