我有这个问题,这是我的代码
?php
$db_host = 'localhost';
$db_user = 'root';
$db_pwd = 'password';
$database = 'nzpcgames';
$table = 'gameinfo';
@ $dbcon = mysql_pconnect($db_host,$db_user,$db_pwd);
if (!$dbcon)
{
die('Could not connect : ' . mysql_error());
exit;
}
mysql_select_db($database, $dbcon);
$query = "SELECT gameinfo.rank, gameinfo.game, gameinfo.platform, gameinfo.genre, gameinfo.publisher, gameinfo.developer, gameinfo.score*
FROM gameinfo
WHERE (((gameinfo.genre)='rpg'))";
$result = mysql_query("SELECT * FROM {$table}");
$num_rows = mysql_num_rows($result);
if ($num_rows == 0) {
echo 'No results were found';
exit;
}
?>
虽然每次我尝试执行它时,我都会收到标题错误。在我的教程 power point 上,它说要更改 $result,但没有说明要更改什么,谢谢您的帮助