I'm doing a system in php
in which I have two tables in one save the records and in another the boxes where each record goes, the result is this way
-------- -------- ---------------
CASILLA SECCION REPRESENTANTE
-------- -------- ---------------
B 1028 14
C1 1028 15
C2 1028
The id
of the representative that I register is saved, but when the query with the inner join
omits the one that does not have id, this is my query:
SELECT
rc.apaterno,
rc.amaterno,
rc.nombre,
encarte.seccion,
encarte.casilla
FROM
encarte
INNER JOIN rc ON encarte.id_representante = rc.id
OR encarte.id_representante IS NULL
and bring me this data
-------- -------- ------------ ------- --------
APATERNO AMATERNO NOMBRE SECCION CASILLA
-------- -------- ------------ ------- -------
cedillo moller carlos 1028 B
marco garcia martinez 1028 C1