
Ayuda con mysqli_fetch_all en hosting
Publicado por Sebastian (35 intervenciones) el 09/04/2016 05:46:41
Saludos, necesito su ayuda. Utilizo la función fetch_all para retornar todas las filas de un array, cuando trabajo localmente en Xampp no tengo ningún problema, pero cuando lo pruebo en mi hosting obtengo el siguiente error.
Fatal error: Call to undefined method mysqli_result::fetch_all() in...
Necesito reestructurar mi código para utilizar fetch_assoc() o = y retornar todas las filas. Investige algo para hacerlo con un loop (while) pero no lo logro.
Función con fetch_all
While
Como puedo reestructurar mi código o mi consulta para hacerlo.???? El while va dentro o fuera de la función.??? Estare muy agradecido por su ayuda.
Fatal error: Call to undefined method mysqli_result::fetch_all() in...
Necesito reestructurar mi código para utilizar fetch_assoc() o = y retornar todas las filas. Investige algo para hacerlo con un loop (while) pero no lo logro.
Función con fetch_all
1
2
3
4
5
6
7
8
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");
$respuesta->fetch_all();
}
While
1
2
3
4
$data = array();
while ($row = $respuesta->fetch_assoc()) {
return $data[] = $row;
}
Como puedo reestructurar mi código o mi consulta para hacerlo.???? El while va dentro o fuera de la función.??? Estare muy agradecido por su ayuda.
Valora esta pregunta


0