SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict Php_penguin's Avatar
    Join Date
    Aug 2004
    Location
    Colwyn Bay, Wales, UK
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Help needed! Guess the difference! [solved]

    Okay, this is beginning to annoy me, as you might guess:

    i have a form which submits a username and password
    i have a mysql SELECT which selects only where the username & password matches up

    so if i enter "bob" and "test" user/pass and i know that a user called "bob" with a password "test" is in the database guess what happens: nothing, 0 rows return...

    however if i call for just where user = "bob" then it returns a line.

    if i then check the two passwords against each other php says they arent equal.

    they are both 'test' but they arent equal, either by == or ===

    anyone got any ideas? thanks in advance!
    Last edited by Php_penguin; Dec 17, 2005 at 16:00.

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can we see the full query?

  3. #3
    SitePoint Addict Php_penguin's Avatar
    Join Date
    Aug 2004
    Location
    Colwyn Bay, Wales, UK
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $lque = "SELECT * FROM `user` WHERE `nick` = '".$nick."' AND `passw` = '".$pass."'";

  4. #4
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks ok.
    if i then check the two passwords against each other php says they arent equal.
    What do they show if you var_dump/print_r them instead of echo/print'ing them?

  5. #5
    SitePoint Addict Php_penguin's Avatar
    Join Date
    Aug 2004
    Location
    Colwyn Bay, Wales, UK
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    woah, nevermind. its started working now. i moved the $pass = $_POST['pass']; to below the mysql_select_db

    the error was the $pass variable in the mysql connection!

    thanks v much mark


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
  •