Posts by MiaSanMia • 84 points
12 posts
-
0
votes2
answers45
viewsA: Problem in Query SQL
Good as I understand the field "quantity_stock" is a numeric and you are trying to increment it by adding it to a string. ($'"+ txtQuantidity.Text +"') My suggestion is to change the query to the…
-
0
votes2
answers347
viewsA: Calling a controller action for views
<?=Yii::$app->controller->renderPartial('listarFilme', ['param1'=>1111, ''=> 22222]) ?> However you need to change the "render" of Actionlstarmovie "renderPartial" also otherwise…
-
0
votes1
answer50
viewsA: Doubt with the LIKE query
You can use php’s PDO. It’s safer and has a higher abstraction. What’s more, it doesn’t need the cycle because the query only returns a record. Take an example. function buscaId ($conexao, $id) {…
-
0
votes2
answers4281
viewsA: Sum variables value with foreach
$valortotal = 0; foreach($grupo as $contas){ if(is_numeric($contas)){ $valortotal = $valortotal + intval($contas["valor"]); } } ?>…
-
0
votes3
answers860
viewsA: make a select by grouping by year
If YEAR is in date format then you can use Mysql SUBSTRING SELECT Count(*) as total , SUBSTRING(year, 1.4) FROM cliente GROUP by SUBSTRING(year, 1,4)…
-
2
votes3
answers195
viewsA: Select with detailed like
MySQL has a set of functions that you can use to work with String, for example SUBSTRING. SELECT * FROM users WHERE 1=1 AND ( SUBSTRING(name,2,16) = "OSIVAN DE SOUSA" OR SUBSTRING(name,1,15) =…
-
0
votes2
answers60
viewsA: result in 2 table columns
Good, Shows the structure of table sff. I simulated the tables with utility classes (code below) and the result was shown below. I didn’t change anything else. <?php /* * * Classes utilitária…
-
1
votes2
answers312
viewsA: How to Sort Records After Count
SELECT * FROM (SELECT @ranking := @ranking + 1 AS rank, `empresas`.`id`, `empresas`.`id` AS `id_empresa`, `empresas`.`id_marca`, `slug`, `slug_bairro`, …
-
0
votes2
answers95
viewsA: Turn a JSON string into a non-associative array in PHP
<?php $data = '{ "mundo":["CE","Supply"], "regional":["CSC","Regional RJ/Verticalizadas"], "entidadeAgrupada":["G&G","BSA - Gráfica"], "unidade":["GGI","BSA - Gráfica"],"area":null }'; $data1…
-
1
votes2
answers312
viewsA: How to Sort Records After Count
order by 1 //se quiser ordenar por "rank" ou order by 10 //se quiser ordenar por "qtd_leads"
-
0
votes1
answer82
viewsA: Login system with sessoes
The coreto is to store the email/username and id, or just the "id" since with the "id" you can get other user data. It’s not a good idea to store a password in the session, 1 for security reasons, 2…
-
2
votes3
answers514
viewsA: Print message on page after echo
Hello, your code is right. What you have to do is make sure you’re running the page on the server, you have to be able to access its page for example like this http://localhost/index.php instead of…