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


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 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, as idPersona, d.nombre as nombreDepartamento, as idUsuario, u.nombre as nombreUsuario
                                              FROM persona as p
                                              JOIN usuario as u
                                              on = u.id_persona
                                              JOIN departamento as d
                                              on u.id_departamento =
                                              WHERE = ".$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

0 answers