rows() expects parameter 1 to be resource

This question already has an answer here:

  • mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource 31 answers

  • error is there

    what happen that your $mysql is putting wrong query ro the db so it return FALSE it is not wrong then mysql_query will return resource to the table...

    $mysql=mysql_query("SELECT Username FROM user WHERE Username='".$_POST['Username']."');
    

    or for example

    $mysql=mysql_query("SELECT * FROM table_name WHERE Username='".$_POST['Username']."');
    

    Your insert query is also wrong..

     $sql = "INSERT INTO User (Username,Password,FirstName,LastName,Email,Address,ContactNumber) VALUES('".$_POST['Username']."','".$_POST['Password']."','".$_POST['FirstName']."','".$_POST['LastName']."','".$_POST['Email']."','".$_POST['Address']."','".$_POST['ContactNumber']."')";
    
    链接地址: http://www.djcxy.com/p/69588.html

    上一篇: PHP错误。 解析错误:语法错误

    下一篇: rows()期望参数1是资源