I am in the process of rewriting into prepared statements and have the following :
but am getting a 'Fatal error: Call to undefined method mysqli_stmt::get_result() '. I realized my php was an older version and went ahead and installed 5.4.21 through easy apache.. confirmed with echo phpversion(); and still get the error.
I was under the assumption that 5.4 would correct this issue with the native driver needed for this statement... is that wrong? MySQL version is 5.1.70-cll.
Any ideas?
Code:
// Store user db info in session for use
$stmt = $mysqli->prepare("SELECT id,user,pass,email,timezone,lastIP,currIP,dtLastLogin,dtCurrLogin FROM test_users WHERE user = ?");
// bind params
$stmt->bind_param('s', $user);
// execute prepared statement
$stmt->execute();
// results to array
$rs = $stmt->get_result();
$arr = $rs->fetch_all(MYSQLI_ASSOC);
// close statement
$stmt->close();
//store array into session
$_SESSION['user']= $arr;
I was under the assumption that 5.4 would correct this issue with the native driver needed for this statement... is that wrong? MySQL version is 5.1.70-cll.
Any ideas?