Posts by William Aparecido Brandino • 848 points
34 posts
-
0
votes3
answers83
viewsA: Select different value from "X" name
I do not know what version of the comic used, because the question is without the flag. In Postgres, you can use the NOT ILIKE: SELECT * FROM tabela_clientes WHERE status ILIKE 'pendente' AND…
-
3
votes3
answers1237
viewsA: How to insert a new line in the json file, using PHP?
First, transform and array: /*Vendo que, a variável é o nome do array, previamente implementado*/ $assignment = json_decode($json,TRUE); In sequence using OR array_push or even incrementing the…
-
1
votes1
answer747
viewsQ: Problems with encoding in Database Query
When trying to execute a SELECT, using fields that store data in the JSON structure, I see a problem with the data that may come: SELECT tbl_pf.nome, tbl_pf.adicionais::JSONB->'recebeTaxa' AS…
-
2
votes1
answer143
viewsA: List of subscribers to a Youtube channel
The list is long: This link is the Youtube API Has that term: youtube.activities.list, that returns all events of a channel. Take a look at how API requests work, but in a quick look, the start is…
youtube-apianswered William Aparecido Brandino 848 -
3
votes5
answers14934
viewsA: Sort Datatable Datetime Field
Complementing this answer, which is setting in specific fields, there is a way of identifying the fields, to then do the ordering: 1 - Setting up Jquery: jQuery.extend(jQuery.fn.dataTableExt.oSort,…
-
15
votes6
answers12128
viewsA: Error typing GIT PUSH
It is not enough to write only git push, it is necessary to write which remote and the branch which will be updated. Example: git push teste branchDeTrabalho…
-
2
votes3
answers287
viewsA: Do you need to use the third bind* parameter?
The description in documentation is: public bool PDOStatement::bindValue ( mixed $parameter , mixed $value [, int $data_type = PDO::PARAM_STR ] ) Showing that the entry of this parameter is…
-
3
votes2
answers316
viewsQ: json_encode returns the asort() order
The method asort() is used to sort arrays, without losing the index. I sort both the SQL search and the array. However, when sending the data via JSON (using json_encode), he rearranges the keys.…
-
3
votes3
answers11972
viewsQ: Updating page after time
I made a page for real-time data sample, and need real-time update after 3 minutes. I tried that code: $(function() { setTimeout(function(){ location.reload(); }, 180000); }); Unproven. I don’t know…
-
1
votes2
answers100
viewsA: Format php number
Even putting the answer up as right, your job number_format is in wrong use: number_format($valor, 2, ',', '.'); It does not accomplish the CAST of a number, just format it. So that I put, puts a…
phpanswered William Aparecido Brandino 848 -
1
votes2
answers29
viewsA: validation filter_input php
The filter_input, in addition to bringing the result, also makes the field validation, bringing FALSE. I recommend doing: if (!filter_input(INPUT_POST, 'romaneio')) { $romaneio = 'null'; }…
phpanswered William Aparecido Brandino 848 -
1
votes4
answers232
viewsA: How to change the date order of an implode from a jquery datepicker
datepicker does not modify the order. This is coming from your request. Just deal with PHP: list($ano,$dia,$mes) = explode("-",v_datainicio); $nova_data = $ano.'-'.$mes.'-'.$dia;…
-
4
votes3
answers461
viewsA: How to run . sh file on button
If it is released on your server, use system() Example: $comando = "./bin/importa.sh"; $parametros = $_POST['parametros']; system($comando $parametros,$retorno); Receiving $parametros to pass to the…
-
0
votes3
answers1626
viewsA: It is possible to collect data of the whole month in postgresql
Has to use BETWEEN: SELECT dados FROM tabela WHERE tabela.data BETWEEN '2016-01-01' AND '2016-01-31' If the field in question is of the TIMESTAMP type, depending on your BD, you should remember to…
-
0
votes2
answers250
viewsA: Phpmailer alternative Gmail From
It has to be another set of code to send this. I’ve come across this problem and only managed to make another call in the class. EDIT: After uploading, use the class ClearAddress(). After sending…
-
-1
votes3
answers994
viewsA: Query with connection to more than one mysql php database
The caution that must be taken, in systems with more than one BD, is that it logically becomes a system with several CONNECTIONS. What I see are the data and all connecting at the same time, so do…
-
1
votes3
answers367
viewsA: Run a SELECT JOIN with conditions for different tables
Make a CASE: SELECT ticket_mensagem.*, CASE WHEN ticket_mensagem.usuario_tipo = 1 THEN tabela_admin.nome ELSE tabela_usuario.nome END AS nome FROM ticket_mensagem LEFT JOIN tabela_admin ON…
-
2
votes2
answers418
viewsA: How to reverse FILTER_SANITIZE_SPECIAL_CHARS
According to the page of SANITIZE, the encoding was in ASCII. But as this case is encoding an apostrophe, It would be better if your Sanitize be like this: $resposta = filter_var("hug'…
phpanswered William Aparecido Brandino 848 -
1
votes4
answers3950
viewsA: When to use ternary condition?
I had doubts about the use of the ternary and, considering the great ease that the ternary can bring, besides today have improved the visualization (this stack is about Javascript, but PHP brings in…
-
1
votes2
answers279
viewsA: Syntax for INTERVAL use
My question was resolved as follows: SELECT CASE WHEN (tabela01.data_abertura::date - (tabela02.garantia || 'month')::interval) <= tabela01.data_nf THEN 'Dentro do Prazo' ELSE 'Fora do Prazo' END…
postgresqlanswered William Aparecido Brandino 848 -
2
votes2
answers279
viewsQ: Syntax for INTERVAL use
I have the following excerpt from a CASE in my SQL SELECT CASE WHEN (tabela01.data_abertura - INTERVAL tabela02.garantia 'month') <= tabela01.data_nf THEN 'Dentro do Prazo' ELSE 'Fora do Prazo'…
postgresqlasked William Aparecido Brandino 848 -
1
votes5
answers1390
viewsA: Page redirection according to access country
Depending on your PHP version, read the PHP documentation about Location class
-
3
votes5
answers163
viewsA: Is there a tool to make html manuals easy to update?
Here at the company we are using the Gitbook, great manual tool, using MARKDOWN, references to external pages and files works with versioning. It’s really worth it.…
-
4
votes5
answers14272
viewsA: Add all the latest changes to the commit in git
If they are files NEW, there’s no escape from git add -A or git add ., however, if there are changes in files EXISTING: git commit -am "Sua Mensagem" Already add and send a message to your branch…
gitanswered William Aparecido Brandino 848 -
5
votes2
answers3965
viewsA: How do you "synchronize" a branch with a master before working on it?
The most common is: Create another branch from the updated MASTER; Do the git merge with your branch that wants to continue; So, you see if there are any conflicts, check the code with the changes…
-
0
votes2
answers275
viewsA: Separate json response for tags
Your call is not coming with JSON, but a standard text. use the following line: $aux = variavel_que_recebeu_o_texto.split(","); You will have an array and can handle your output.…
-
0
votes2
answers1041
viewsA: Load client data into a PHP modal
At the end of the block called by the modal, the page should end with exit();, because it will limit itself to calling only the block (I imagine by ajax) of the code. EDIT: DO NOT USE THE HEADER! It…
-
1
votes1
answer284
viewsQ: Comparison with recorded data such as JSON
I have a date field that is saved to the field in JSON format, along with other values {"data_limite":"14\/07\/2016","data_programada":null,"admin_agendamento":"4813"} This field "deadline", I need,…
postgresqlasked William Aparecido Brandino 848 -
0
votes1
answer99
viewsA: Unanswered PHP in fetch command
First: table name is on CAPITAL? Second, are the connections correct? Third: The constant changes of PHP in relation to Mysql (depreciation of mysql_* in relation to mysqli_*) made me search and…
-
0
votes2
answers127
viewsA: How to check if at least 1 checkbox has been selected?
Using array, you could even filter: if(filter_input_array(INPUT_POST) in a row, you would treat all $_POST
phpanswered William Aparecido Brandino 848 -
2
votes2
answers4179
viewsA: Validating CPF and CNPJ with php Function
When you receive the variable in your valida_cpf_cnpj: Remove the special characters Count the numbers: If it’s 11, CPF. 14, CNPJ Then just do the validations…
phpanswered William Aparecido Brandino 848 -
1
votes1
answer42
viewsA: PHP implode without return
To get this result, the array in question must be in the following format: foreach($uid['data'] as $k){ $arr_ids[] = $k; } This must be outside the FOREACH…
phpanswered William Aparecido Brandino 848 -
3
votes2
answers57
viewsQ: Callable in Javascript
I have a list of id’s on buttons: <button id="grafico01">Pontuação por MARCAS</button> <button id="grafico02">Pontuação por EQUIPAMENTOS</button> <button…
-
1
votes3
answers9570
viewsA: Update DIV without refreshing the JQUERY page
The right one would be to "stop" the event of Ubmit. On the first line, put: event.preventDefault(); This will not make Submit perform its function, and will continue with the rest of the code.…