1
Good afternoon! I’m having a problem on how to think of something effective.
I have two tables: budget and budget:
- Soap
- Inks
- Bags
All these records have the id_orcamento associated to the table orcamento, basically its function is to group all the rows of the other table. So far so good, everything works correctly!
Here is the question: I need to print on the screen by "Blocks", ie: pick up all the rows of the table orcamentos_lines and group with table values budget and all these values will be printed on div1 (example) And the other rows, associated with another table record budget will be printed in the div2 (example) and so on
The problem is that I’m not being able to think of a logic to do this, I tried a few things, but the end result has always been to print each line followed by the other. Follow the code I currently use:
$sql_select = "SELECT * FROM orcamentos_linha INNER JOIN orcamentos ON (orcamentos.id = orcamentos_linha.id_orcamento AND DATE(orcamentos.data_limite) > CURDATE() ) WHERE cad = ?";
$stmt = $database->prepare($sql_select);
$stmt->execute([$user->getCad]);