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*/
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php