PHP/MySQL User Membership

MastAZMastAZ BeginnerLink Clerk
Hi im new to all this PHP/MySQL stuff and I followed the Advanced PHP/MySQL User Membership Script tutorial closely. I have it all set up and I can register. After registering I get a new window saying 'Registration was succesful'.

I would then log in with the details that I registered with and I get the following message:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/wwwmast/public_html/members/login.php on line 80

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/wwwmast/public_html/members/login.php on line 88
Username and passwords do not match our records


What is causing this and how can I sort it?

Thanks in advance,

MastA Z

Comments

  • PythonPython Forum Leader The Royal RAM
    Ok

    Could you please post the code which resides on those lines and a few surrounding lines so I can look into it.

    Thanks

    The Royal Ram

  • MastAZMastAZ Beginner Link Clerk
    OK here are lines 72 to 90:

    // search database to check for user

    $request = "SELECT * FROM users WHERE password='".$pass."' AND username='".$user."'";



    // hand over the request

    $results = mysql_query($request,$conn);





    // if mysql returns any number of rows great than 0 then there is a succesful login

    if(mysql_num_rows($results))

    {
  • PythonPython Forum Leader The Royal RAM
    [PHP]// search database to check for user

    $request = "SELECT * FROM users WHERE password='".$pass."' AND username='".$user."'";



    // hand over the request

    $results = mysql_query($request);





    // if mysql returns any number of rows great than 0 then there is a succesful login

    if(mysql_num_rows($results))

    {[/PHP]

    Try changing those lines to the above... Then let me know if it worked or not.

    The Royal Ram

  • MastAZMastAZ Beginner Link Clerk
    Nope exactly the same error
Sign In or Register to comment.