我不斷收到使用的錯誤消息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 回答
- 3 回答
- 0 關(guān)注
- 496 瀏覽
添加回答
舉報
0/150
提交
取消