I am a newbie to php and MySQL. I have a Windows XP computer using IIS 5.1 and have installed php-5.3.3 which seems to work OK (phpinfo() returns no errors). I have also set up mysql-5.1.53. I don't know if my problem is with php or mysql or both. I have a file – mysql_test.php (below), which returns the following error in Firefox: “PHP Parse error: syntax error, unexpected '>' in F:\mysql_test.php on line 23”. IE only returns “HTTP 500 Internal Server Error”.
Can anyone help? Thank you.
mysql_test.php:
<?php
/* Program: mysql_test.php
* Desc: Connects to MySQL Server and
* outputs settings.
/
echo "<html>
<head><title>Test MySQL</title></head>
<body>";
$host="http://localhost/";
$user="root";
$password="1234"; /* not my real password /
$cxn = mysqli_connect($host, $user, $password);
$sql="SHOW STATUS";
$result = mysqli_query($cxn,$sql);
if($result == false)
{
echo "<h4>Error: ".mysqli_error($cxn)."</h4>;
}
else
{
/* Table that displays the results */
echo "<table>
<tr><th>Variable_name</th>
<th>Value</th></tr>";
for($i = 0; $i < mysqli_num_rows($result); $i++)
{
echo "<tr>";
$row_array = mysqli_fetch_row($result);
for($j = 0;$j < mysqli_num_fields($result);$j++)
{
echo "<td>".$row_array[$j]."</td>\n";
}
}
echo "</table>";
}
?>
</body></html>