I'm tryign to creat user_login system for my website. And now i got problems with selection of user_info from database , using mysqli and prepared statements . My problem is , that i can't get any output . But i'm using the manual at php.net . Here is what i have got the moment:
<?php
require_once 'php/includes/constants.php';
$connection = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME)or die("Error");
$phone = "0661488342";
$password = "1234";
$query = " SELECT *
FROM userinfo
WHERE phone = ? AND password = ?
LIMIT 1";
$stmt = $connection->prepare($query);
$stmt->bind_param('ss', $phone, $password);
$stmt->execute();
$res = $stmt->get_result();
$row = $res->fetch_assoc();
echo "Password = ".$row['password'];
The error :
Call to undefined method mysqli_stmt::get_result() in Z:...
Can you advise me something about this ?
Edition 1 PHP version is 5.2.12.(sorry, i forgot this) But the question remains the same . How can i get the user_info ?