1
I am developing a software where the user selects the items from his home, selects how long not to clean them, and at the end fills a form to receive a discount by email and clean the items. All this data goes to the bank.
However, when doing the Inner Join to display on the front end, the registered item only recognizes the first ID (in this case, id 1)
How can I fix this? my tbl_item is:
My sql code is:
SELECT email_cadastrado, nome_cadastrado, nome_item, descricao
FROM tbl_cadastrados c
JOIN tbl_item i ON c.item_cadastrado = i.id_item
JOIN status_cadastrado cad ON c.status_cadastrado = cad.id
where cad.id = 0"
John, JOIN won’t go through your field (1,3,4)... The error is probably in your table creation loop. Post to see how is generating the table.
– rbz
In advance before seeing, you will probably have a loop to handle the items within the loop that generates the table.
– rbz
Use this function: http://php.net/manual/en/function.explode.php
– rbz
@Raonibz Warning: explode() expects Parameter 2 to be string, array Given in C: xampp htdocs quiz_Acaro Etapa2.php on line 11
– Joao Pedro
i’m treating the variable like this: $checkBoxValue = Join(", ", $_POST['item']); $_SESSION['item'] = $checkBoxValue;
– Joao Pedro
You can’t understand with pieces like that. As Luiz said in the answer, the relationship is wrong, but you can do it this way too, you need to see what you find easier. Breaking the field and bringing nomenclature or make ratio from 1 to 1. I think it’s best to post everything as is, there the staff gives you ways to do.
– rbz