I get an error message in my localhost. I use WAMP.
1049:Unknown database 'address_book'
I think MySQL is not set up right.
<HTML>
<HEAD>
<Title>Data</TITLE>
</HEAD>
<BODY>
<?php
$qry = 'SELECT * FROM info Order BY Id ASC';
$conn=mysql_connect("$location","$username","$pass word"
; //connect to sql server
$sql = mysql_query($qry,$conn) or die(mysql_errno().':'.mysql_error());
// the above will tell you what, if any, is the mysql error //
while ($rows = mysql_fetch_array($sql)) {
$Id = $rows -> Id;
$FirstName = $rows -> FirstName;
$LastName = $rows -> LastName;
$Email = $rows -> Email;
echo 'First Name: ' . $FirstName . '<br /> Last Name: ' . $LastName . '<br /> Email: ' . $Email . '<br />';
}
?>
</BODY>
</HTML>
I went looking on MySQl via PHPAdmin and got this:
Server: localhost
$cfg['Servers'][$i]['pmadb'] ... not OK [ Documentation ]
$cfg['Servers'][$i]['relation'] ... not OK [ Documentation ]
General relation features: Disabled
$cfg['Servers'][$i]['table_info'] ... not OK [ Documentation ]
Display Features: Disabled
$cfg['Servers'][$i]['table_coords'] ... not OK [ Documentation ]
$cfg['Servers'][$i]['pdf_pages'] ... not OK [ Documentation ]
Creation of PDFs: Disabled
$cfg['Servers'][$i]['column_info'] ... not OK [ Documentation ]
Displaying Column Comments: Disabled
Bookmarked SQL query: Disabled
Browser transformation: Disabled
$cfg['Servers'][$i]['history'] ... not OK [ Documentation ]
SQL history: Disabled
$cfg['Servers'][$i]['designer_coords'] ... not OK [ Documentation ]
Designer: Disabled
Do you see anything wrong in the set up of MySQL? and How do I fix It? An yes I do have a DB name 'address_book'
Airwolf09