0
This code below is bringing repeated values on the screen.
Could someone help me ?
$id_credenciado = $_SESSION['id_credenciado'];
//$sql = mysqli_query($conn, "SELECT DISTINCT * FROM tb_protocolo INNER JOIN tb_certidao ON tb_protocolo.id_credenciado = tb_certidao.id_credenciado WHERE tb_protocolo.id_credenciado = $id_credenciado AND tb_certidao.id_credenciado = $id_credenciado");
$sql = mysqli_query($conn, "SELECT DISTINCT * FROM tb_protocolo INNER JOIN tb_certidao WHERE tb_protocolo.id_credenciado = $id_credenciado AND tb_certidao.id_credenciado = $id_credenciado");
This code is bringing repeated values on the screen.... Could someone help me ?
– Javã
How are your table structures?
– Pedro Paulo
If you use
*
in the query will bring all of the two tables, and it is absolutely ok to bring duplicated data if it is not a relation1:1
. See that some field should be different, not everything will be 100% equal.DISTINCT
will not solve the problem with*
because any different field configures a different line– Ricardo Pontual