警告:mysqli_ERROR()需要精確的一個(gè)參數(shù),0給定的錯(cuò)誤我正在學(xué)習(xí)一個(gè)教程,但是本教程的作者不回答問題-但這是我的查詢我得到了以下錯(cuò)誤警告:mysqli_error()需要精確的1參數(shù),0給定,問題在于這一行代碼-$query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error());整個(gè)代碼是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?謝謝
警告:mysqli_ERROR()需要精確的一個(gè)參數(shù),0給定的錯(cuò)誤
慕的地6264312
2019-07-03 10:26:38