0

I need your help Tried the following and getting fatal error.

Fatal error: Call to a member function fetch_all() on a non-object

function getMenusuno()
 {
global $conex;
$respuesta= mysqli_query ($conex, "SELECT M.menu_nombre, M.menu_ruta FROM   privilegios P INNER JOIN menus M ON P.menu_id = M.menu_id WHERE   tipousu_id='".$_SESSION['resultipo']."' AND M.menu_id BETWEEN '1' AND '4' ORDER BY p.menu_id ASC");
return $respuesta->fetch_all();
}

function conectar()
{
global $conex;
$conex = @mysqli_connect  ('localhost','user','xxxx,','doceispu_sisdocprueba');
@mysqli_set_charset($conex, 'utf8');
}

When I work locally no problem

In a web hosting, the error occurs. Please help!!!

sebastianpe93
  • 71
  • 1
  • 1
  • 6

2 Answers2

-1

In such situation, add a debug statement after you mysqli_query instruction to find yourself.

echo '<pre>'; var_dump($respuesta); echo '</pre>';
DotMG
  • 36
  • 4
-1
  1. check your connection parameters & check whether mysqli is enable in your web server or not
Dipanwita Kundu
  • 1,637
  • 1
  • 9
  • 14