I\'m new to PHP OOP so this question must be quite dumb. I\'m unable to create an SQL query through PHP. I\'ve read the code many times but I\'m unable to find any discrepa
$stmt_chk_email = $con->prepare('SELECT `column` FROM `user_information` WHERE `Email` = ?');
$stmt_chk_email->bind_param('s', $_POST['email_add']);
$stmt_chk_email->execute();
$stmt_chk_emeil->store_result();
$stmt_chk_email->bind_result($check_email);
$stmt_chk_email->fetch();
echo $check_email;
OR
$stmt_chk_email = $con->prepare('SELECT * FROM `user_information` WHERE `Email` = ?');
$stmt_chk_email->bind_param('s', $_POST['email_add']);
$stmt_chk_email->execute();
$result = $stmt_chk_email->get_result();
if($result->num_rows == 1)
{
$result = $result->fetch_array();
echo $result['column_name'];
}
you cant echo this
echo $stmt_chk_email;
you maybe want to echo this
$stmt_chk_email = $con->prepare('SELECT column1 ,column2,... FROM `user_information` WHERE `Email` = ?');
$stmt_chk_email->execute();
$stmt_chk_email->store_result();
$stmt_chk_email->bind_result($column1 ,$column2,.....);
$stmt_chk_email->fetch();
echo $column1;
echo $column2 ;
.....