Posts by MikeDoouglas • 450 points
18 posts
-
9
votes4
answers634
viewsA: What is the difference between i += 2 and i = i + 2?
I found something interesting on the PEP-203 which is where they propose the Augmented assignment (i += 2): The idea behind the increased assignment in Python is that it’s not just an easier way to…
-
-1
votes1
answer167
viewsA: Error in PHP zip code query
You can use the function html_entity_decode. Example: $var = "http://cep.republicavirtual.com.br/web_cep.php?formato=xml&cep=88160-282"; echo html_entity_decode($var);…
-
0
votes2
answers572
viewsA: How do I do a NAME search filter in PHP ?
Try to adjust the following 1º - if condition: if(isset($_POST['palavra']) != '') for: if(isset($_POST['palavra'])) 2º - Inside the if: $pesquisa = "where nome like '%palavra%' "; for: $pesquisa =…
-
0
votes1
answer50
viewsA: How to recover date field (mysql+php)?
Remove the quotes from the column name: $dados = mysqli_query($conexao, "SELECT data FROM tabela");
-
1
votes1
answer40
viewsA: Update the first input when inserting
I believe the error is here: success: function (data) { $(".success_messages").removeClass('hide'); $("#NumEsq").val(data["numEsq"]); }, The return date is being object and not array, the correct…
-
0
votes1
answer39
viewsA: Increment value in a function name
I know the following ways to do this: <?php for($i=0;$i<$count;$i++): ?> $nomeMetodo = 'getFile' . $i; // 1 $this->{$nomeMetodo}($arg1, $arg2, $arg3); // 2 $this->$nomeMetodo($arg1,…
-
3
votes1
answer199
viewsA: Update with two Yii2 models
You need to have both models in your Update form (Student and Address), and in the controller find the Student, and after the student, search the Address using the foreign key that will be in the…
-
1
votes2
answers973
viewsA: Browse table with N lines with FOR and find specific values
I did a jQuery foreach on td from the table, and saved took the value using .val() of each element. function ValidarStatusGrid() { var table = $("#tbPedidos"); table.find('tbody tr').each(function()…
-
1
votes3
answers302
viewsA: Submit form with buttons outside it
Values of Submit buttons are not being sent $jQuery.(). Then you can pass these values by post with Hidden input, and not by name button. Ex: <div style=\"display:none\"> <div id=\"ajax2\"…
jqueryanswered MikeDoouglas 450 -
0
votes3
answers190
viewsA: Ajax upload does not send image and parameter
I believe it is because you forgot to declare the Event parameter of the click() function, e.g.: $("#btnOcorrenciaSalvar"). click(Function(Event) { and you called without him:…
-
1
votes1
answer226
viewsA: Perform one page function on another
You can use the Localstorage to save the coordinates and on the next page get them. Localstorage is a storage space in the user’s browser. Ex: // Salva na página anterior…
-
0
votes4
answers41221
viewsA: How to dispose images next to each other with titles below in css?
You need to use width and display: inline-block; of the CSS. <!DOCTYPE html> <div class="box"> <img…
-
0
votes2
answers56
viewsA: PHP - Javascript
Your previous implementation using PHP was more correct because you don’t need to send 100 items from a table and will only display 10 for example, ends up affecting unnecessarily the performance.…
-
2
votes2
answers67
viewsA: Browse an array where the index is a Date
Riding with a foreach Ex: foreach ($arrayBanco as $chave => $valor) { echo $valor['conteudoID']; } Note that in your code each position of the main array returns another array, which is where you…
-
2
votes1
answer1060
viewsA: Limit the number of pages in PHP MYSQL paging
You need to limit this on for: $margemDireita = 2; $margemEsquerda = ($pagina > 2) ? 2 : 0; for ($i = $pagina - $margemEsquerda; $i < $pagina + $margemDireita; $i++) { $ativo = ($i == $pagina)…
-
0
votes1
answer144
viewsA: Yii2 PHP Framework get value Radiolist
One of the options passed in the $values array will be selected by the user, and it will be possible to manipulate this value in the Controller of this view, for example: create.php <div…
-
3
votes1
answer2450
viewsA: INNER JOIN sql query with WHERE and GROUP BY
It is necessary to group all columns with equal types. Ex: SELECT a.codigo_loja_produto, a.codigo_loja, a.codigo_produto, b.nome_produto, b.codigo_barras, b.secoes_produtos, b.endereco_fotos,…
-
-2
votes1
answer333
viewsQ: REST API endpoint standard
I’m creating an application similar to Twitter using Laravel and React, where the database has tables: Post, User, Relation, Mention and Repost. On the 'Timeline' screen of the application will be…