Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given
当我尝试使用下面的代码时出现错误。
include('config.php');
$con = mysql_connect($dbhost,$dbuser,$dbpasswd);
if (!$con)
{
die('Could not connect: ' . mysql_error());
} else {
mysql_select_db($dbname, $con);
}
$date = getdate();
$result = mysql_query("SELECT * FROM '" . $table_prefix . "users' where user_regdate = '" . $date . "'");
$total = 0;
while($row = mysql_fetch_array($result))
{
$total++;
echo $row['username'];
echo "<br />";
}