Does not show result mysqli

0

Someone has an idea why when doing the query that is with mysqli (even if the table in question does not exist in the database) always gives blank results? I'm stuck with a query to the BBDD, in the backoffice it works correctly and the same query in public shows nothing.

Greetings

--- New from here ---

Text in the web index.php

    include $nivel.'panel/includes/php/conexion.php'; 

    $sqlmarca = "SELECT * FROM marcas";
    echo $sqlmarca;
    $res_marca = mysqli_query($conexion, $sqlmarca) or die('Consulta fallida: '.mysqli_error($conexion));  

    while($fila = mysqli_fetch_array($res_marca));
    {
    echo '<br>Hola<br>';
    }

the $ level only adds /../ or not to a route, depending on the level at which you are, that is, if you are root it would be / if you are in a lower folder it would be /../, etc. In theory the 'Hello' above should come out more than once, since in the DB I have several brands.

Text in the backoffice (this works)

    //Listado de Marcas
    $sql_marcas = "SELECT * FROM marcas ORDER BY marca";
    $res_marcas = mysqli_query($conexion, $sql_marcas) or die('Consulta fallida: ' . mysqli_error($conexion));

    while($fila = mysqli_fetch_assoc($res_marcas)) 
    { 
    Echo 'Marcas';
    }
    // Liberar resultados
    mysqli_free_result($res_marcas);

PD: question edited

    
asked by Franxo Bass 10.08.2016 в 02:22
source

1 answer

0

Dear, you have a ; left at the end of while :

 while($fila = mysqli_fetch_array($res_marca)); <---
    
answered by 10.08.2016 / 12:42
source