malikah Posted July 22, 2009 Share Posted July 22, 2009 Just wondering how to get the whole row as an array in the following prepared statement: function verifyUsernameAndPass($un, $pw) { $query = "SELECT * FROM login WHERE user = ? AND pass = ? LIMIT 1"; if($stmt = $this->conn->prepare($query)) { $stmt->bind_param('ss', $un, $pw); $stmt->execute(); if($stmt->fetch()) { $stmt->close(); return true; } } } Quote Link to comment https://forums.phpfreaks.com/topic/166989-prepared-statement-row-as-array/ Share on other sites More sharing options...
Daniel0 Posted July 22, 2009 Share Posted July 22, 2009 http://php.net/manual/en/mysqli-stmt.bind-result.php Quote Link to comment https://forums.phpfreaks.com/topic/166989-prepared-statement-row-as-array/#findComment-880452 Share on other sites More sharing options...
malikah Posted July 22, 2009 Author Share Posted July 22, 2009 http://php.net/manual/en/mysqli-stmt.bind-result.php Yea, already been there - nothing I try will put the row into an array. I've tried putting one of the array() variables into a $_SESSION[] variable but it comes back as blank.. Quote Link to comment https://forums.phpfreaks.com/topic/166989-prepared-statement-row-as-array/#findComment-880463 Share on other sites More sharing options...
Daniel0 Posted July 22, 2009 Share Posted July 22, 2009 Well, then maybe show the code using that method so we can tell you what you're doing wrong. Quote Link to comment https://forums.phpfreaks.com/topic/166989-prepared-statement-row-as-array/#findComment-880500 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.