error in web hosting but not in xampp when doing a sql search

0

The error that appears to me is the following

Error looking for Users:

  

You have an error in your SQL syntax; check the manual that   corresponds to your MariaDB server version for the right syntax to use   near '' at line 7

On my local xampp PC I can see the information saved on the visited page but the webpage can not.

My hosting is www.000webhost.com and I use the same version of php in the 2 servers (5.6), which I do not know if there are different versions of mysql that are the cause of the error

My sql search

function searchUser($conexion, $id){

        $consulta = (mysqli_query($conexion, "SELECT *, p.nombre as personaNombre, p.id as idPersona, d.nombre as nombreDepartamento, u.id as idUsuario, u.nombre as nombreUsuario
                                              FROM persona as p
                                              JOIN usuario as u
                                              on p.id = u.id_persona
                                              JOIN departamento as d
                                              on u.id_departamento = d.id
                                              WHERE u.id = ".$id." ")) or die("Error buscando Usuarios: ".mysqli_error($conexion));

        return $consulta;
    }

What am I doing wrong? I already tried to upload the file again without success

    
asked by Juan Ortiz 25.11.2018 в 02:04
source

0 answers