Posts by Sérgio Louro • 71 points
6 posts
-
1
votes1
answer32
viewsA: SQL query with 3 tables, summation in 2 and aggregation
Hello, dnat! You can do this using subconsultation. See the example below: SELECT clientes.nome, (SELECT SUM(ValorCons) FROM consultas WHERE idCli = clientes.idCli) AS total_consultas, (SELECT…
sqlanswered Sérgio Louro 71 -
0
votes2
answers19
viewsA: How to use select with php and Pdo
According to the documentation the function exec() returns the number of affected rows (changed or deleted). As you are doing a select, no record is being changed, causing the function to return 0.…
-
1
votes1
answer23
viewsA: Handle array objects from AJAX
Erik, Since you are using a multidimensional array, you need to use a foreach (for example) to access the products and save them in the database. Follow the example: $vendafinal =…
-
0
votes1
answer24
viewsA: How to not leave so much unused space on the screen (Scroll bar so large)
What is harming developing the screen as you would like is the attribute width: 80rem in class .input-cadastre. I did some tests here applying the attribute max-width: 100% in the class and the…
-
-2
votes1
answer25
viewsA: Create dynamic multi-level menu (Tree Menu)
Yes, it is possible! However, to make it easier to help you, please insert in your question the table structure that the menu items will be. Remember that with PHP and Mysql you will be able to make…
-
1
votes1
answer33
viewsA: sql query returning false
Apparently your query is returning some error (probably from syntax). I recommend you add the following code below this line: $resultado_produtos = mysqli_query($conn, $result_produtos);…