Hi guys, I’m learning PHP and I am trying to retrieve data from a mySQL database. Can someone tell me what is wrong with the code below. I get a blank screen when I access the php document from a web browser even though there is one row of data in the table. I have already successfully installed PHP,Apache and MySQL. I am on WindowsXP, Apache 1.3, MySQL 4.0.21. Thanx in advance.
<?php
$mysql_access = mysql_connect("localhost","","");
mysql_select_db("test", $mysql_access);
$query_Recordset1 = "SELECT * FROM pet";
$Recordset1 = mysql_query($query_Recordset1, $mysql_access) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php echo $row_Recordset1['name']; ?>
<?php echo $row_Recordset1['owner']; ?>
<?php echo $row_Recordset1['species']; ?>
<?php echo $row_Recordset1['birth']; ?>
<?php echo $row_Recordset1['sex']; ?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>