SELECT 'forma','id_produto','id_lanche','qtd_max',
if('id_lanche' in (select 'id_lanche' from 'produtos'
where 'id_lanche' = {$id_produto}),'checked','') as marca FROM 'formas'
Product DB = Products
db recipe = shapes
This code does the following work: Search in db the id
of the product and the revenue that it is.
And it marks the ingredients and their quantity.
id nome id_lanche preço
1 X-egg 1 7.00
2 X-tudo 2 9.00
tabela receita
id id_produto id_lanche preço quantidade (quantiodade no caso e quanto o produto tem de cada item)
1 1 1 1.00 1
2 2 1 2.00 2
3 3 1 2.00 2
4 4 1 3.00 1
5 1 2 1.00 1
6 2 2 2.00 2
7 5 2 2.00 1
8 4 2 3.00 1
Alface [X] 1x [ ] 2x [ ] 3x
Bacon [ ] 1x [X] 2x [ ] 3x
Queijo Cheddar [ ] 1x [X] 2x [ ] 3x
Mostarda dijon [X] 1x [ ] 2x [ ] 3x
bife [ ] 1x [ ] 2x [ ] 3x
pão [ ] 1x [ ] 2x [ ] 3x
Alface [ ] 1x [ ] 2x [ ] 3x
Bacon [ ] 1x [ ] 2x [ ] 3x
Now I need it to also delete the duplicate elements ... But noting if it is checked or not ... I put a group by
forms. But it does not distinguish whether it is marked or not.