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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

錯誤:警告:mysql_num_rows()期望參數(shù)1為資源,在第19行的C:\ xampp

錯誤:警告:mysql_num_rows()期望參數(shù)1為資源,在第19行的C:\ xampp

PHP
慕妹3242003 2019-11-04 13:04:54
我不斷收到使用的錯誤消息mysql_num_rows(),您能幫我弄清楚我的代碼出了什么問題嗎?這是我的代碼:<?php //check if the user press submitif (isset($_POST['submit'] )) {    $customer = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["username"]); // filter everything but numbers and letters    $password = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["password"]); // filter everything but numbers and letters    $sql = mysql_query("SELECT id FROM members WHERE username='$customer' AND password='$password' LIMIT 1"); // query the person    // ------- MAKE SURE PERSON EXISTS IN DATABASE ---------    $existCount = mysql_num_rows($sql); // count the row nums    if ($existCount == 1) { // evaluate the count         while($row = mysql_fetch_array($sql)){              $id = $row["id"];         }         $_SESSION["id"] = $id;         $_SESSION["customer"] = $customer;         $_SESSION["password"] = $password;         header("location: index.php");         exit();    } else {        echo 'That information is incorrect, try again <a href="customer_login.php">Click Here</a>';        exit();    }}?>我已經(jīng)mysql_errno()按照您的建議嘗試了..它回顯1146當我搜索該錯誤時說1146: Table 'kossu.nonexistenttable' doesn't exist但是我不知道這意味著什么...請幫助。
查看完整描述

3 回答

?
元芳怎么了

TA貢獻1798條經(jīng)驗 獲得超7個贊

可能mysql_query()失敗了。在這種情況下,它返回false。使用mysql_error()找出會發(fā)生什么。


查看完整回答
反對 回復(fù) 2019-11-04
?
倚天杖

TA貢獻1828條經(jīng)驗 獲得超3個贊

我真的不知道,我還要說些什么。該表kossu.nonexistenttable不存在。我認為,這確實很明顯,這意味著什么。在您的情況下,似乎沒有members要查詢的表。另外我mysql_error()沒有說mysql_errno()。對于第一個,您將收到具體的錯誤消息,而不是不確定的錯誤代碼。這比您從PHP手冊中獲得的示例輸出要有用一些;)

查看完整回答
反對 回復(fù) 2019-11-04
  • 3 回答
  • 0 關(guān)注
  • 496 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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