第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Mysqli_Query警告:mysqli_query()期望參數(shù)1為mysqli

Mysqli_Query警告:mysqli_query()期望參數(shù)1為mysqli

慕容森 2019-08-14 15:28:51
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è)贊

你正在混合mysqlimysql擴(kuò)展,這將無(wú)法正常工作。

你需要使用

$myConnection= mysqli_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql"); mysqli_select_db($myConnection, "mrmagicadam") or die ("no database");

mysqli與原始mysql擴(kuò)展相比有許多改進(jìn),因此建議您使用mysqli。


查看完整回答
反對(duì) 回復(fù) 2019-08-14
  • 2 回答
  • 0 關(guān)注
  • 1052 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)