Do not perform the search in tables

0
$instruccion = mysql_query("SELECT id_cliente FROM inspeccion WHERE '" . $_POST['concepto'] . "  LIKE '%" . $_POST['busqueda'] . "%' AND id_cia='".$cia."'
                           INNER JOIN clientes ON id_cliente.clientes = id_cliente.inspeccion 
                           ORDER BY id_cliente DESC LIMIT 1,1");

Good afternoon here again you can give me a hand with this inner join which falls directly to query failure. Thank you in advance

    
asked by Francisco Javier Inzunza Cid 14.09.2017 в 17:35
source

1 answer

0

In the inner join it is the reverse ON clientes.id_cliente = inspeccion.id_cliente instead of ON id_cliente.clientes = id_cliente.inspeccion in the table.field always goes first the table and then the field

I also think that you will be marked with an ambiguity error since both tables have a client_id field, you must specify one, for example instead of SELECT id_cliente put SELECT clientes.id_cliente same in the order by ORDER BY clientes.id_cliente

    
answered by 14.09.2017 в 17:40