Thread: PDO Fetch

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    85
    Rep Power
    3

    PDO Fetch


    I am trying to fetch data with the PDO and manipulate the data where the rows would be in the database. When I go to login, nothing happens. I stay at the screen.

    PHP Code:

    while($row $stmt->fetch(PDO::FETCH_LAZY)){
                        if(
    $row['usr']) {
                
    // If everything is OK login
                
                
    $_SESSION['usr']=$row['usr'];
                
    $_SESSION['id'] = $row['id'];
                
    $_SESSION['rememberMe'] = $_POST['rememberMe'];
                
                
    // Store some data in the session
                
                
    setcookie('tzRemember',$_POST['rememberMe']);
                            
    header("Location: index.php");
                            
            } else {
                        
    $err[]='Wrong username and/or password!';
                    }
                    
                    } 
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Does any of your error output trigger? is the cookie set? are there entries in the logs? have you tried to do anything to debug this page other than grab 9 lines of it and paste it on a forum?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    85
    Rep Power
    3
    Originally Posted by ManiacDan
    Does any of your error output trigger? is the cookie set? are there entries in the logs? have you tried to do anything to debug this page other than grab 9 lines of it and paste it on a forum?
    I was able to get it. I had to get rid of the ''. I also had help from a friend.

IMN logo majestic logo threadwatch logo seochat tools logo