本文介绍了mysql_num_rows()期望参数1是资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! Helo编码器 我正在尝试将记录插入数据库表但我收到此错误 mysql_num_rows()期望参数1为资源,布线在第107行的C:\ wamp \ www.hn_nations_\\register.php中给出 我不知道出了什么问题。请帮助 include('localhost.php'); if(isset($ _ POST [SubmitButton])){ $ fullname = $ _ POST ['FirstName']; $性别= $ _ POST ['YourGender']; $ AgeGroup = $ _ POST ['AgeGroup']; $ Organization = $ _ POST ['Org']; $目的= $ _ POST ['目的']; $ NRC = $ _ POST ['NRC']; $省= $ _ POST ['省']; $ dbDate = $ _ POST ['dbDate'] ; $地址= $ _ POST ['地址']; $ query = mysql_query(SELECT * FROM学生WHERE NRC ='$ NRC'); $ numrows = mysql_num_rows($ query); //这是我编辑中的第107行 if($ numrows == 0){ $ sql =(INSERT INTO`school`设置FullName ='$ fullname ',Gender ='$ Gender',AgeGroup ='$ AgeGroup',Organization ='$ Organization',目的='$目的',NRC ='$ NRC',省='$省',dbDate ='$ dbDate' ,Address ='$ Address'); $ result = mysql_query($ sql); if($ result) echo数据已保存; }否则{ echo无法保存数据; } } ?>Helo CodersI'm trying to insert a record into a database table but i'm getting this error mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\United_Nations\register.php on line 107I do not know what is wrong. Please helpinclude('localhost.php');if (isset($_POST["SubmitButton"])){$fullname=$_POST['FirstName'];$Gender=$_POST['YourGender'];$AgeGroup=$_POST['AgeGroup'];$Organisation=$_POST['Org'];$Purpose=$_POST['Purpose'];$NRC=$_POST['NRC'];$Province=$_POST['Province'];$dbDate=$_POST['dbDate'];$Address=$_POST['Address'];$query=mysql_query("SELECT * FROM students WHERE NRC='$NRC'");$numrows=mysql_num_rows($query); // this is line 107 in my editorif($numrows==0){$sql = ("INSERT INTO `students` set FullName='$fullname', Gender='$Gender', AgeGroup='$AgeGroup', Organisation='$Organisation', Purpose='$Purpose', NRC='$NRC', Province='$Province', dbDate='$dbDate', Address='$Address'");$result=mysql_query($sql);if($result)echo " Data has been Saved ";}else {echo "Could not Save Data";}}?>推荐答案 _POST [SubmitButton])){_POST["SubmitButton"])){ fullname =fullname= _POST ['FirstName'];_POST['FirstName']; 这篇关于mysql_num_rows()期望参数1是资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的.. 09-08 03:57