SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Session

  1. #1
    SitePoint Addict Resident Evil's Avatar
    Join Date
    May 2003
    Location
    Barrow
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Session

    I Get This Error When I a MClearleh Not Calling For R.
    Unknown column 'r' in 'where clause'

    Can Anyone See Whats Up?

    PHP Code:
    <?
    session_start();

    include("config.php");
    include("db_connect.php");

    $login_name = $_POST['login_name'];
    $login_password = $_POST['login_password'];

    if((!$login_name) || (!$login_password)) {
        
            die("Couldnt Get Your User Info");
            exit();
            }
        
        $password = md5($login_password);
        $query = "SELECT * FROM accounts WHERE login='$login_name' AND password='$password'" or die(mysql_error());
        $result = mysql_query($query) or die(mysql_error());
        $login_check = mysql_num_rows($result);

        if($login_check > 0) 
            {
            while($row = mysql_fetch_array($result)){ 
            foreach($row AS $user_data => $val ){ 
            $$user_data = stripslashes($val); 
            } 
            
            session_register('login');
                $_SESSION['login'] == $login_name;
                
            session_register('password');
                $_SESSION['password'] == $login_password;
                
                }
            }

      $day = date("l");
      $date = date("F d, Y");
      $time = date("g:iA");
            
            mysql_query("UPDATE logged_in SET timestamp='".time()."', logged_in='y', last_login='$day $date $time' WHERE id=".$user_data['id']."") or die(mysql_error());
                header("Location: ?p=overview");
                
        


    ?>

  2. #2
    SitePoint Zealot DraginX's Avatar
    Join Date
    Mar 2003
    Location
    US
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $query = "SELECT * FROM accounts WHERE login='$login_name' AND password='$password'" or die(mysql_error());
    $result = mysql_query($query) or die(mysql_error
    ());

    try removing one of those mysql_error()) dies

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DraginX: You don't have to set the font and color manually. Try putting code inside [ php ] tags (without spaces, though).

  4. #4
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mattjacob: He didn't, that's the WYSIWYG kicking in (copy'n past includes formatting).

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Gaheris
    mattjacob: He didn't, that's the WYSIWYG kicking in (copy'n past includes formatting).
    Ah...that must only be when you use the enhanced text entry box.

  6. #6
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice spotted DraginX.
    Quote Originally Posted by DraginX
    try removing one of those mysql_error()) dies
    However, it's not indifferent which one you remove. You should have it like this.
    PHP Code:
    $query "SELECT * FROM accounts WHERE login='$login_name' AND password='$password'";
    $result mysql_query($query) or die(mysql_error()); 
    -Helge


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
  •