0
Good morning! will someone help me with a question?
i have a select
SELECT * FROM order
INNER JOIN kn_status ON (kn_order.n_order = kn_status.fk_order)
WHERE kn_order.fk_cliente='$id'
the problem is that in the table STATUS the N_ORDER is repeated several times and when I execute the WHILE it shows me the result of the repeated ORDER table.
It would be more valid if you showed what you have in the table and what the expected result
– Sorack
But how do you want to bring only 1 record and have several repetitions of it in the STATUS table? You need to pass another single 'parameter' in order to bring a single row. Your JOIN in the table structure is wrong in my view. You should have mounted the structure with an ID_STATUS (SINGLE) as a foreign key and not an order number that is not presented there. If possible post the table structure.
– Clayton Tosatti