警告:mysqli_ERROR()需要精确的一个参数,0给定的错误我正在学习一个教程,但是本教程的作者不回答问题-但这是我的查询我得到了以下错误警告:mysqli_error()需要精确的1参数,0给定,问题在于这一行代码-$query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error());整个代码是session_start();require_once "scripts/connect_to_mysql2.php";
//Build Main Navigation menu and gather page data here$sqlCommand = "SELECT id, linklabel FROM pages ORDER BY pageorder ASC";
$query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error()); $menuDisplay = '';while ($row = mysqli_fetch_array($query)) {
$pid = $row["id"];
$linklabel = $row["linklabel"];
$menuDisplay .= '<a href="index.php?pid=' . $pid . '">' . $linklabel . '</a><br />';} mysqli_free_result($query);所包含的文件有以下行$myConnection = mysqli_connect("$db_host","$db_username","$db_pass","$db_name") or die ("could not connect to mysql");
with reference to $myConnection, why do I get this error?谢谢
3 回答
慕标琳琳
TA贡献1830条经验 获得超9个赞
$myConnection = mysqli_connect("$db_host","$db_username","$db_pass","$db_name") or die ("could not connect to mysql");
添加回答
举报
0/150
提交
取消