Hi I'm having problems accessing my server i'm using mysql on my laptop apache2 and php. my problem is i can seem to connect to db but can't get any data out of the registered table inside the db. Thanks in advance always i'm running window7.
<?php
$username = "root";
$password = "deslap";
$hostname = "localhost";
#connection to the database seems to work and prints connected to MySQL
$dbhandle = mysql_connect($hostname, $username, $password)or die("Unable to connect to MySQL");
echo "<br />Connected to MySQL<br>";
#select a database to work with
$selected = mysql_select_db('registered',$dbhandle)or die("Could not select database");
#execute the SQL query and return records.
$result = mysql_query("SELECT id, Name FROM registered");
while($row = mysql_fetch_array($result))
{
echo "ID:".$row{'id'}." Name:".$row{'name'}."Email: ".$row{'Email'};
}
?>
</body>
</html>