Posts by Marcio Jalber • 705 points
31 posts
-
1
votes3
answers141
viewsA: Result range
A simple way to solve this problem would be GROUP BY CAST( DATE_FORMAT(data,'%Y%m%d%H%i') / 5 AS UNSIGNED )
-
1
votes2
answers671
viewsA: Faster delete + Insert or select + update
My dear, I have some remarks for you: I do not recommend deleting the data, because if some day there is failure or delay in sending the data by the company, you will have an unavailable data window…
-
0
votes4
answers83
viewsA: Only join if the above query returns records
Hello, please try the following code: SELECT * FROM ( SELECT * FROM Tabela1 UNION SELECT * FROM Tabela2 ) a WHERE EXISTS( SELECT 1 FROM Tabela1 )
-
1
votes3
answers688
viewsA: How to do in a select html, when clicking select more than one row at a time?
Please see if what you want to solve like this: SELECT GROUP_CONCAT( `mes` SEPARATOR ', ' ) `mes` FROM `tabela` WHERE `mes` IN('JAN.16', 'FEV.16', 'MAR.16');
-
0
votes2
answers650
viewsA: Add 1 month function in php fails when current month has no day 31
I have the following suggestion, which I believe solves your problem clearly. if($recorrencia == "UNICA") return; $recorrencias = [ 'MENSALMENTE' => 1, 'BIMESTRALMENTE' => 2, 'TRIMESTRALMENTE'…
phpanswered Marcio Jalber 705 -
1
votes2
answers135
viewsA: How to delay the Vuejs v-model?
If you are using Vue.js version 2.x. x, Lazy is no longer a property and has become a modifier. Then try <input v-model.lazy="msg">.
vue.jsanswered Marcio Jalber 705 -
-2
votes2
answers1343
viewsA: How to calculate runtime in PHP
Utilize time() instead of microtime()
-
1
votes1
answer42
viewsA: Mounted() not executed
My dear, take off the mounted is not a Vue method but a step in the instance life cycle. That is, move the mounted() of methods to the root of classe and try again. So: ` export default { data(){…
vue.jsanswered Marcio Jalber 705 -
0
votes3
answers211
viewsA: Delete duplicate records via php in mysql
the SQL below should suit you: DELETE FROM hardware WHERE id IN ( SELECT a1.id FROM hardware a1 JOIN ( SELECT MAX(id) id, IP FROM `hardware` GROUP BY IP HAVING COUNT(1) > 1 ) a2 ON a2.IP = a1.IP…
-
0
votes6
answers710
viewsA: On Click only works once
Try: $(document).ready(function() { $('li[name=music] a').on('click', function () { $(this).next().toggle(); }); });
-
0
votes2
answers1188
viewsA: How to load dropdown list using Angularjs and php
HTML code: <html> <head>...</head> <body ng-app = 'app'> <div ng-controller='MainController'> <div class="form-group"> <label…
-
-1
votes2
answers90
viewsA: Destroy Session when changing profile on mobile and affect pc
If you write user data in session, this problem will happen every time you open more than one session to the same user (be it PC+mobile, be PC+PC, etc). To solve this, there are three ways. 1) You…
-
-4
votes3
answers2136
viewsA: Error 500 Internal Server Error
Dude. The best thing you have to do is create a script to make the mistakes right away. So you’ll always know what’s going on. Study about the functions set_error_handler, mkdir e fwrite and about…
-
-1
votes3
answers825
viewsA: getJSON PHP shows no result
It may be that you are going to the browser some output after echo. Try terminating PHP like this echo json_encode( $resultado); exit();. In javascript, you can use the following code: $.post ( url,…
-
-1
votes3
answers2513
viewsA: Can I use "mysql_real_escape_string" on "mysqli_connect" website?
Dude, learn and use PDO. PHP 7 has already been released, which has rendered all the mysql_* functions obsolete, rendering legacy code incompatible. Eventually you will have to deal with this…
-
2
votes2
answers340
viewsA: Why is my query not working with the php variable
Make sure that what comes from the post is equal to the content searched. I like to do so... echo '-'.$nome.'-';. You may have spaces in your name. Clear them: $nome = trim( $_POST[ 'nome' ] );.…
-
1
votes3
answers795
viewsA: PHP database text for html
I believe the problem is not with the function nl2br. Check the output before applying the function to be sure. It also seems that the firebug automatically quotes the console when it comes to more…
-
1
votes3
answers1954
viewsA: Problems adding item to array with Angularjs
Use one of the codes below: $scope.user.roles[id]['3'] = 1; or var oidsa = {"3": 1}; angular.extend( $scope.user.roles[id], oidsa );
-
1
votes1
answer960
viewsA: How do I make an image appear on the full screen only in mobile mode?
So what you want is not the image as html background, but the background only of the first page. If so, use the code below: // html <!DOCTYPE html> <html> <head>...</head>…
-
1
votes4
answers1821
viewsA: String and variable concatenation problem in jquery load function
Man, the problem must be us option's his select. Make sure you’ve written your select as <option value='ba'>Bahia</option>. In the case I mentioned, if you use $('#estados').val(), he…
-
1
votes3
answers4462
viewsA: How to display the result of a form on the same page?
Try: <?php if ( count( $_GET ) && isset( $_GET['peso'] ) && isset( $_GET['peso'] ) ) { ?> // Digite o código do cálculo do resultado aqui Fazer novo cálculo <?php } else {…
-
0
votes2
answers280
viewsA: Assemble date/time from month informed by user
Try: <?php $mes = 11; $data = substr_replace( date( 'Y--d H:i:s' ), $mes, 5, 0 );
phpanswered Marcio Jalber 705 -
0
votes4
answers732
viewsA: How to create a function to scroll through a dynamically created PHP page and change certain text
You better simplify the code. See the example below: <?php function acertaTexto( $texto, $sexo = 'masculino' ) { if ( $sexo === 'masculino' ) { $Ao = 'Ao'; $ao = 'aa'; $O = 'O'; $o = 'o'; $a =…
phpanswered Marcio Jalber 705 -
3
votes5
answers1643
viewsA: Difference between private and final methods
Private indicates that the property or method is not inherited by the child classes and only the proprietary class can access the property or method. Final indicates that the child class can inherit…
-
3
votes8
answers1094
viewsA: Is it recommended to use constants for configuring a PHP project?
You must use constants only to store information that do not change and shall be accessible anywhere in the project. In all other cases, I recommend using a configuration file accessible through a…
-
0
votes8
answers5012
viewsA: Printing a String until a space is found
First clear the white spaces on the left. Then, if it is a user input, it can enter "other characters that are not spaces", such as the invisible character, a ENTER or a TAB. Or it may be that it…
-
23
votes9
answers41109
viewsA: What is a programming language, IDE and compiler?
In practical and simple terms, it follows: programming language is for informatics just as language is for humans - has words, syntax, spelling, etc. compiler is a tool that turns your cute code…
-
1
votes2
answers126
viewsA: Remove last table item and reset a new item above the first
The best thing to do is to create a 'dataCadastro' column and delete co a SQL Delete form table Where dataCadastro = min( dataCadastro )
-
2
votes1
answer304
viewsA: URL friendly with various paramteros in htaccess
Replace the last three lines with Rewriterule . * index.php Then manipulate the contents of $_SERVER[ 'REQUEST_URI' ].
htaccessanswered Marcio Jalber 705 -
0
votes2
answers1135
viewsA: Check if pattern is followed, JSON and PHP
Try the following code: $entrada = json_decode( $json, true ); $params = array( ... ); $intersecao = array_intersect_assoc( $entrada, $params ); $sucesso = count( $intersecao ) == count( $params );…
-
9
votes6
answers8335
viewsA: How to know if the form is sent
$_POST is a array and you can use count( $_POST ) to check if something has been sent, otherwise 0 will be returned. But empty( $_POST ) will also make the check, with the difference that will…
phpanswered Marcio Jalber 705