Posts by PaulinhoCaP • 327 points
17 posts
-
1
votes1
answer58
viewsQ: PHP xdebug3 with Docker in Ubuntu 20.04 does not work
Good afternoon Devs all right, I’m having trouble trying to run Xdebug with Docker on Ubuntu 20.04. Below follows my config. Docker-Compose.yml version: '3.7' networks: supervisao: services: nginx:…
-
2
votes2
answers119
viewsA: Mysql group by month and year between dates
Try it this way. SELECT * FROM agenda where (BETWEEN agenda.dia_inicio AND agenda.dia_termino) GROUP BY MONTH(dia_termino), DAY(dia_termino)
mysqlanswered PaulinhoCaP 327 -
0
votes2
answers68
viewsA: Join a cell from an html table [closed]
For your case I suggest using array_sum(). After the sum you can create a tfooter and put the values as the last option. Below is the documentation link.…
-
3
votes1
answer63
viewsA: How to ensure the Insert of all MYSQL data
You can use Transaction, this ensures that all transactions are carried out, if any error nothing will be committed or inserted follows example. try{ $db->beginTransaction(); // sua regra INSERT…
-
0
votes5
answers195
viewsA: Sending view string to controller via Ajax. Codeigniter, javascript and php
Passes the entire url without the route this way: <script type="text/javascript"> fetch('http://localhost/page.com.br/public/Post_notification/insert_id_post_notification', { method: "POST",…
-
0
votes2
answers96
viewsA: Radio input array in PHP form
Sam’s answer is good and solves your problem, but based on your comment I will suggest a second alternative: for ($n = 0; $n < $totquestoes; $n++) { $al = $n + 1; $cod = $linha['codprova']; $q[]…
-
0
votes1
answer158
viewsA: Swap subselect with Oin
FELIPE, follows the idea of how to do JOIN SELECT DISTINCT A.ID FROM BANCO..TABELA1 A JOIN TABELA1 B ON A.id = B.iD WHERE A.COLUNA = '123' AND B.ID != 456 ORDER BY A.ID…
-
0
votes2
answers38
viewsA: How to transform this query to lavarel?
As Glenys comments there are several ways to query, I will give a hint using Eloquent instead of Facade DB. $query = Model::query(); $query->where(function($q){…
-
1
votes2
answers88
viewsA: How to feed an array using data from another array in php?
Marcos, good afternoon as this using Eloquent, there are several ways to map an Array in Laravel and get the result you want, you can use the function map collecet(), since its return returned a…
-
1
votes1
answer33
viewsA: Laravel. How to use request to perform APP search
Good morning Andrew, you are passing the entire Request object, you are also missing the first parameter of the Where clause that would be the comparison column in the database, in your 'ID'…
-
0
votes2
answers89
viewsA: Consultation Laravel Eloquent 3 belongtomany tables
The way you did it brings the desired result, and finally you do not want what has admin name to include in the query a second parameter, by default when the second parameter is omitted Eloquent…
-
1
votes1
answer1927
viewsQ: HTTP redirect to HTTPS with LARAVEL
Good afternoon devs, I’m having trouble rerouting HTTP to HTTPS, I have the following content in my . HTACCESS # Redireciona para o HTTPS independente do domínio RewriteCond %{HTTPS} off RewriteRule…
-
2
votes1
answer151
viewsQ: Datatable start with default value
I’d like some help with my problem. I wonder if there is the possibility to start datatables with the search field already filled with a default value. I tried it this way.…
-
2
votes1
answer64
viewsQ: Group result through a conditional
I wonder if in Mysql or any other Bank you have the possibility to use GROUP BY with a conditional. I will try to explain I have a status column that can have the value true and false, would like to…
-
1
votes2
answers1154
viewsQ: Generate line break in Vuejs with v-if
I have a method that does a search in an api made in Arabic and returns me a json, I need to go through this json in a v-for and every 3 interactions a new Row is created. In PHP it would look…
-
0
votes1
answer144
viewsQ: Search with date in Laravel
Devs, good afternoon I’m having the following problem, I have the sequinte query I’m running with DB::raw() From Laravel, I need the date to be passed to query as a string with simple quotes only so…
-
2
votes2
answers239
viewsQ: Creation of tables with cardinality 1 : N
I have two tables, PRODUTOS and INSUMOS. To create a product I need several inputs, I would like to know how I should proceed with this relationship in Mysql. I must create a table called COMPOSICAO…