I am trying the following code to get results from query and display it in the tes.php
page.
db.inc.php
<?php
function db_connect()
{
$handle=new mysqli('localhost','rekandoa','rekandoa','rekandoa');
if (!$handle)
{
return false;
}
return $handle;
}
function get_member()
{
$handle=db_connect();
$sql="Select email,nama,alamat,kota,propinsi from users where email=?";
$stmt=$handle->prepare($sql);
$mail='[email protected]';
$stmt->bind_param("s",$mail);
$stmt->execute();
$stmt->bind_result($email,$nama,$alamat,$kota,$propinsi);
$result=$stmt->fetch();
return $result;
}
?>
tes.php
<?php
error_reporting(E_ALL & ~E_NOTICE);
include('db.inc.php');
$w=get_member();
echo $w['member_id'];
echo '<br>';
echo $w['email'];
echo '<br>';
echo $w['status'];
echo '<br>';
?>
I got no error message but the results are not shown, it is just a blank page.
What did I do wrong?