Why am I getting this error
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/freddwit/public_html/test.php on line 13
Warning: mysqli_error() expects parameter 1 to be mysqli, resource given in /home/freddwit/public_html/test.php on line 15
Error:
Here is my code:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/freddwit/public_html/test.php on line 13
Warning: mysqli_error() expects parameter 1 to be mysqli, resource given in /home/freddwit/public_html/test.php on line 15
Error:
Here is my code:
Code:
<?php
/*program
*
*/
echo "<html><head><title>Test Mysql</title></head>
<body>";
$host="localhost";
$user="freddwit_peter";
$password="thinkbig1102";
$cxn=mysql_connect($host, $user, $password);
$sql="SHOW STATUS";
$result=mysql_query($cxn, $sql);
if ($result == FALSE) {
echo "<h4>Error: ".mysqli_error($cxn)."</h4>" ;
}
else
{
/*table that displays results*/
echo "<table border='1'>
<tr><th>Variable name</th>
<th>Value</th></tr>";
echo "<tr>";
$row_array= mysql_fetch_row($result);
for ($j = 0;j <mysqli_num_fields($result); $j++)
{
echo "<td>".$row_array[$j]."</td>\n";
}
echo "</table>";
}
?>
</body></html>
Comment