Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Login and join up page

  1. #11
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    There are simpler ways to make a login/register form using $_SESSION ...
    - Josh

  2. #12
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    can you try to separate this?

    here: if (( $num = mysql_num_rows($result) ) and ($passwort != ""))

    allow $num to hold the arguments.
    then apply this to an if condition

    $num = mysql_num_rows($result);
    if ( ( $num ) and ($passwort != "") )

  3. #13
    Join Date
    Aug 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re:{topic}

    I think i got something to do with Database

    Quote Originally Posted by JShor View Post
    I get the error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/jarodco/public_html/login/login.php on line 30 when logging in.

    I think what's happening is that you have an incorrect sql query syntax, causing mysql_num_rows(x); to have a null value.

    You;re using $_SESSION to get a result, but if there's no session [via the conversion from GET to SESSION, it will have a null result of course.

    Try replacing that area of code w/this:
    PHP Code:
        // convert username and password from _GET to _SESSION 
        
    if($_POST){ 
          
    $_SESSION['username']=$_POST["username"]; 
          
    $_SESSION['passwort']=$_POST["passwort"];   
        } 
    Replace all GET with POST, that's basically it.

    HTH

  4. #14
    Join Date
    Aug 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I try that but i make it a bit more made
    Quote Originally Posted by jarodco.me.uk

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/jarodco/public_html/login/login.php on line 2

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/jarodco/public_html/login/join.php on line 3
    Username: Password:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/jarodco/public_html/login/login.php on line 33
    Login Failed.

    Username:

    Password:

    Quote Originally Posted by rm_dynamicdrive View Post
    can you try to separate this?

    here: if (( $num = mysql_num_rows($result) ) and ($passwort != ""))

    allow $num to hold the arguments.
    then apply this to an if condition

    $num = mysql_num_rows($result);
    if ( ( $num ) and ($passwort != "") )

  5. #15
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    try this:

    after this line you add:
    $result=mysql_query($sql);
    $num=mysql_num_rows($result);

    if($num=0) {

    } else { et.......


    or check your query.

    $sql = "SELECT * FROM sys_user WHERE username = '$username' AND passwort = '".md5($passwort)."' OR passwort = PASSWORD($passwort))";

    how?

    1. after that command put die($sql); okay.
    2. when php reach the die command the query string appear on your screen.
    3. use your mysql command line or any mysql software copy/paste the result and you will see what will happen.
    Last edited by rm_dynamicdrive; 08-08-2009 at 12:52 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •