Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Dec 2003
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    STUPID ERRORS...Uhhh

    hi,
    im trying to make a simple login system but whenever i execute the query from the script with mysql_query i get no answer.
    However, when i execute the same query in phpmyadmin i get the answer....its making me so nervous!!!!!ohhhhh

    PHP Code:
    SELECT username,passwd FROM gl_users WHERE username='fimi' AND passwd='ef43d744e6227ce0cca48d34a2a4880a'

    // that is the result of:
    $query "SELECT username,passwd FROM gl_users WHERE username='$u_name' AND passwd='$u_pass'";

    //now, when i try to see how many rows were effected get no answer! 

    $result mysql_query($query) or die("Error: " mysql_error());

    //       NOW FOR      mysql_num_rows($result) i get now value!!!! 

    WTF is going on??????
    what m'i doing wrong?

    thx....

  • #2
    Regular Coder
    Join Date
    May 2003
    Location
    34 54' N 82 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What error(s) are you getting? That would help us help you.

    Also, if you want a good, sound login system you might want to try Nightfire's Login Lite - http://blinded.org.uk/scripts/loginlite.php
    Last edited by SDP2006; 12-13-2003 at 11:44 PM.
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #3
    New Coder
    Join Date
    Dec 2003
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts
    lol, i don't get any errors!
    simply, i got get answers from the database!

  • #4
    Regular Coder
    Join Date
    May 2003
    Location
    34 54' N 82 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If there is nothing in the database, you will get nothing from the database. Sorta like the bank, if there is no money in it, you cant get any money out.
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #5
    New Coder
    Join Date
    Dec 2003
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes i know but the when i execute that query in the database i get an answer....and im 100% sure that i should get the result back.

    about Nightfire's Login Lite i have the same thing(same ideas and stuff like that).

  • #6
    Regular Coder
    Join Date
    May 2003
    Location
    34 54' N 82 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Queries acts a tad differently when executing it inside of a PHP File. What might work in PHPMyAdmin, might not work inside of a PHP file.
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #7
    New Coder
    Join Date
    Dec 2003
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok so what do i do?
    Attached Thumbnails Attached Thumbnails STUPID ERRORS...Uhhh-clip.jpg  

  • #8
    Regular Coder
    Join Date
    May 2003
    Location
    34 54' N 82 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Click 'Create PHP Code' and copy/paste that into your query.
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #9
    New Coder
    Join Date
    Dec 2003
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx alot SDP2006, the site that you gave me it worked!

  • #10
    Regular Coder
    Join Date
    May 2003
    Location
    34 54' N 82 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You're script works now?

    Great! Glad I have been a help.
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #11
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Did you connect to the database?

  • #12
    New Coder
    Join Date
    Dec 2003
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes, it allways connected to the database, but i recieved no results when when there was results.

    i started playing much more and trying EVERYTHING possible and and at some time i got it to work. i think php was just messing me up.

    SDP2006, my script works...thx alot

    im doing templates now....smarty template engine is the best!


  •  

    Posting Permissions

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