need help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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*/

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux