Mysqli_Query警告:mysqli_query()期望參數(shù)1為mysqli 我的代碼中出現(xiàn)此錯(cuò)誤,我不知道如何解決我的代碼:<?phpsession_start();include_once"connect_to_mysql.php";$db_host = "localhost";// Place the username for the MySQL database here$db_username = "root"; // Place the password for the MySQL database here$db_pass = "****"; // Place the name for the MySQL database here$db_name = "mrmagicadam";// Run the actual connection here $myConnection= mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");mysql_select_db("mrmagicadam") or die ("no database"); $sqlCommand="SELECT id, linklabel FROM pages ORDER BY pageorder ASC";$query=mysqli_query($myConnection, $sqlCommand) or die(mysql_error());$menuDisplay="";while($row=mysql_fetch_array($query)) { $pid=$row["id"]; $linklabel=$row["linklabel"];$menuDisplay='<a href="index.php?pid=' .$pid . '">' .$linklabel. '</a><br/>';}mysqli_free_result($query);?>這是錯(cuò)誤的:警告:mysqli_query()期望參數(shù)1為mysqli,第17行的C:\ xampp \ htdocs \ limitless \ connect_to_mysql.php中給出的資源我做錯(cuò)了什么?
2 回答

慕標(biāo)5832272
TA貢獻(xiàn)1966條經(jīng)驗(yàn) 獲得超4個(gè)贊
添加回答
舉報(bào)
0/150
提交
取消