I self learned php and I’m still learning.
The system I’m making, I just want to display all the my sql records in php. i tried for so many times… :’( can anyone help.
this is the code…my database name is abc.and for now it has 5 records.can anyone tell me what wrong with my code?it says the “database doesn’t exist”
[php]
$username="";
$password="";
$database=“abc”;
//connect to sever
$connect = mysql_connect(“localhost”,"","") or die(“sever doesn’t exist”);
//connect to database
mysql_select_db(“sd”) or die(“database doesn’t exist”);
//query the database
$query = mysql_query(“SELECT * FROM client WHERE ClientName = ‘Harry’”);
$num_rows = mysql_num_rows($query);
//fetch the results / convert the results in to a query
if($num_rows > 0)
{
while($row = mysql_fetch_assoc($query))
{
echo $row[‘ClientName’]."
".$row[‘Address’]."
".$row[‘Telephone’]."
".$row[‘Fax’]."
";
}
}
else{
echo “There’s no entries within this database yet”;
}
[/php]