php/sql code gives blank page
| From: | sono at selectcomm dot ab dot ca | Date: | Fri, 03 Aug 2001 16:55:06 +0000 |
| Subject: | php/sql code gives blank page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61155@lists.php.net to get a copy of this message | ||
I created a little php script to run and display stuff on my browser for
printing.
When I run the command I get a blank page though.
I tested the syntax of my command in mysql and on phpMyAdmin to make sure
it worked.
Here is the code:
-------------------------------------------------------------------------------
<?php
mysql_connect("localhost", "user", "password") or die("Could not
connect");
print ("Connected succesfully"); <----THIS DISPLAYS
mysql_selectdb("rtapd") or die("Could not select database");
print ("Selected database"); <-----THIS DISPLAYS
$query = "SELECT timestamp, msg_id, msg FROM pgr_msgs WHERE msg_id=2903092
AND timestamp >= 20010709000000 AND timestamp < 20010803000000";
$result = mysql_query($query) or die("Query Failed");
print ("Query executed and returned"); <-----THIS DISPLAYS
while($row == mysql_fetch_array($result)) {
$timestamp = $row["timestamp"];
$msg_id = $row["msg_id"];
$msg = $row["msg"];
echo" <br>
Time: <b>$timestamp</b><br>
Pager Number: <b>$msg_id</b><br>
Message: $msg<br><br>";
}
?>
-------------------------------------------------------------------------------
Is there something specific in this code that would cause the page to
display blank? (Blank except for the print statements at the top that
tell me whether it connected or not)
I do notice the page take awhile to load(the blank page)...it almost looks
like it is timing out maybe?
Thanks IN advance:)
Cheers
Sono