Can someone point out where the error is please? I run the below code, and instead of it populating the array, it gives me an empty result.
I have check the SQL in my database and it is running fine.
function fetchStatusDetails($cno, $randomPass)
{
$mysqli = $this->_setDB (); // This sets up the DB connection.
if ($stmt = $mysqli->prepare ( "SELECT created_main_menus,created_submenus,picked_a_header_image,uploaded_a_header_image,has_logo FROM " . $this->tableName . " WHERE random_password=? and CNO=? LIMIT 1" ))
{
/* bind parameters for markers */
$stmt->bind_param ( "si", $randomPass,$cno );
$stmt->execute ();
$stmt->bind_result ( $main_menus,$sub_menus,$picked_header_img,$upped_header_img,$logo );
$stmt->fetch ();
if (! empty ( $main_menus ))
{
$array = array();
$array['main_menus'] = $main_menus;
$array['sub_menus'] = $sub_menus;
$array['picked_header_img'] = $picked_header_img;
$array['upped_header_img'] = $upped_header_img;
$array['logo'] = $logo;
echo "*-*-".$array['upped_header_img']."*-*-";
return $array;
}
else
{echo "DATABASE ERROR 0090";
return false;
}
/* close statement */
$stmt->close ();
}