...

View Full Version : Warning: mysql_connect() [function.mysql-connect]



amcf1992
09-14-2011, 08:07 PM
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/user/public_html/account.php on line 21



<?php session_start(); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Account Dashboard</title>
</head>
<body>
<?php
$con = mysql_connect("$host","$user","$password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("$db", $con);

$result = mysql_query("SELECT * FROM $tbl_name" );

while($row = mysql_fetch_array($result))
{
echo $row['FirstName'] . " " . $row['LastName'];
echo "<br />";
}

mysql_close($con);
?>
<a href="logout.php"> Log Out </a>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum