need help
| From: | Frederick Belfon | Date: | Tue, 08 Oct 2002 16:19:03 +0000 |
| Subject: | need help | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-22274@lists.php.net to get a copy of this message | ||
I have Mysql set up on the same machine as the apache server. There is a database name inventory_db
with a table product_info which have the two row id and name. I know there are three records in the
table. However when ever I place this script below into a webpage I get just a blank page. What can
I do to correct it. Thank you
<? php
# connect to mysql
$conn= @mysql_connect("localhost", "root")
or die ("Err:conn");
#select the specified database
$rs= @mysql_select_db("inventory_db", $conn)
or die("Err:Db");
#Create the query
$sql= "select id, name from product_info";
#execute the query
$rs= mysql_query($sql, $conn);
#write the data
while ($row=mysql_fetch_array($rs) )
{
echo("Product ID: " .$row["id"]);
echo(" Product Name: " .$row["name"] "<br>");
}
?>
/*" The gospel is meant to comfort the afflicted and afflict the comfortable."
Garrison Keillor*/