SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot New Oddity's Avatar
    Join Date
    Jun 2001
    Location
    Georgia
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Password problems in php script

    Assume $password = "cheese":

    PHP Code:
    if ($submit1) {
      
        
    mysql_query("INSERT INTO pwords SET pword = PASSWORD($password)");
        
    $msg .= mysql_error();
        
      } 
    Error:

    Unknown column 'cheese' in 'field list'
    --Odd
    "We all live in a yellow subroutine."
    "Some call it insanity; I call it inspiration!"

  2. #2
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to put $password in quotes within the SQL:
    PHP Code:
    mysql_query("INSERT INTO pwords SET pword = PASSWORD('$password')"); 

  3. #3
    SitePoint Zealot New Oddity's Avatar
    Join Date
    Jun 2001
    Location
    Georgia
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why are the simplest things the worse to figure out? Oh well... thanx, now All have to do is get it to check the passwords...
    --Odd
    "We all live in a yellow subroutine."
    "Some call it insanity; I call it inspiration!"


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
  •