Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在PHP SQL MAX函数中显示数据_Php_Sql_Max_Die - Fatal编程技术网

在PHP SQL MAX函数中显示数据

在PHP SQL MAX函数中显示数据,php,sql,max,die,Php,Sql,Max,Die,我根本无法让这个PHP代码工作。 if(!$connecton) { die("Connection Failed" . $mysql_error()); } mysql_select_db("rewiredstate",$connection); $max="SELECT MAX('Unique ID') as id FROM topics"; $maxquery= mysql_query($max) or die (mysql_error()); while($row = mysql_f

我根本无法让这个PHP代码工作。
if(!$connecton) {
die("Connection Failed" . $mysql_error());
}

mysql_select_db("rewiredstate",$connection);

$max="SELECT MAX('Unique ID') as id FROM topics";
$maxquery= mysql_query($max) or die (mysql_error());
while($row = mysql_fetch_assoc($maxquery)) {
echo $row['id'];
}
?>
它只是说:

注意:在第9行的C:\xampp\htdocs\Opinions\script.php中使用未定义的常量died-假定为“died” 死

我已经在PHPMyAdmin中检查了SQL,这很好。任何帮助都将不胜感激


提前谢谢

我想你把别名和身份证弄混了。可以这样尝试:
$max=“选择max('id')作为唯一的\u id FROM topics”

可以代替您给定的
die()