I am creating a test php program to access a mysql database and
am getting a few errors. Please let me know how I can correct them.
Thanks in advance
PHP 5.1.2
MYSQL 5.0
Windows 2000
IIS
Warning: mysqli_query() expects parameter 1 to be mysqli,
string given in C:\TESTIT\Ernie Test Connection.php on line 16
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result,
null given in C:\Documents and Settings\Administrator\Desktop\TESTIT\Ernie Test
Connection.php on line 26
$user="root";
$host="localhost";
$password="";
$database = "memberstats";
$connect = mysqli_connect($host,$user,$password)
or die(mysql_error());
$db = mysqli_select_db($connect,$database)
or die(mysql_error());
$pettype = "dragon";
$query = "SELECT * FROM userinfo WHERE petType='$pettype'";
$result = mysqli_query($query,pettype)
or die(mysql_error());
/ Display results in table /
$pettype = ucfirst($pettype)."s";
echo "<h1>$pettype</h1>";
echo "<table cellspacing='15'>";
echo "<tr><td colspan='3'><hr></td></tr>";
while ($row = mysqli_fetch_array($result))
{