I've been trying to echo the output of SQL SELECT statement but an error keeps displaying which says: The code is mentioned below: $con = new mysqli('localhost', 'root', '', 'my_database'); if ($con->connect_error) { echo 'Failed to connect' . $con->connect_error; } else { echo 'Connected'; $stmt_chk_email = $con->prepare('SELECT * FROM `user_information` WHERE `Email` = ?'); $stmt_chk_email->bind_param('s', $_POST['email_add']); $stmt_chk_email->execute(); echo $stmt_chk_email; } Code (markup): Obviously, I don't want to just echo the SQL query. I haven't mentioned the later part of the code because I wanted to see that what part of the code is erroneous by echoing the result. So it seems like that the query is not running at all. I've checked the syntax and it seems to be quite fine. My editor is also not displaying any error so its obvious that the logic is flawed. I'd appreciate if someone figures that one out. Thanks.
I think you getting array as result. it means you have either print_r it, or echo exact key from array like this: echo $stmt_chk_email[0]; however firstly do print_r then youll be able to see whole array output and determine what do you want to echo exactly. Las thing would be simply foreach $stmt_chk_email to see what it outputs like this: foreach ($stmt_chk_email as $key => $item){ echo $item[$key]; }