我在我的代碼,這個錯誤,我不知道如何解決它 我的代碼:Mysqli_Query警告:mysqli_query()預計參數1是mysqli的
<?php
session_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);
?>
,這是錯誤:
Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in C:\xampp\htdocs\limitless\connect_to_mysql.php on line 17
你能幫助我請
提示:使用搜索功能來搜索您正在收到的確切錯誤消息。我可以保證你以前這個問題已經回答了很多次。 – deceze 2012-04-15 08:50:59