Posts by Benilson • 426 points
20 posts
-
0
votes2
answers114
viewsA: Advanced Firebird Join - I can’t join the tables I need and sort in the right result
One of the ways to solve your problem is by using sub-consultations with alias and Join or left Join, depending on the situation, as below: SELECT COMP.*, VEND.VENDA FROM ( SELECT A.SECCOD,…
-
0
votes2
answers67
viewsA: Compare changed values in object array
You can go through the arrays and then go through each object attribute and compare the values as below. Arrays have to have the same size and objects have the same attributes, which seems to be…
javascriptanswered Benilson 426 -
1
votes1
answer60
viewsA: Select row from table
I made relevant modifications only in the coloring part, the explanation is in the comments. $(function() { // Monitora o evento mesmo que a linha seja criada dinamicamente…
-
0
votes2
answers147
viewsA: Query and display JSON data according to url parameter
You can use the method match of strings with a regular expression equivalent to the mes=year pattern, to know which month and year were reported in the url. If it doesn’t find the pattern, it does…
-
0
votes1
answer42
viewsA: Undefined index in SELECT with INNER JOIN in PHP table
The table name does not go next to the name of the fields in the query results. As some fields have the same name in different tables, I had to add aliases to them. Follow the settings: <?php try…
-
0
votes2
answers48
viewsA: Subtract fields inside while in PHP
When the measurement does not exist, define using the first one, then keep the one that is set. Then only use in the consumption calculation. I slightly changed your code and added some comments.…
-
1
votes1
answer274
viewsA: Show input when checking checkbox
I made some modifications to your code, no need to worry about id or class in this example, just use the element clicked and grab your parent element, in case td and take the child element of that…
-
1
votes1
answer51
viewsA: Cancel or repeat alert in js
I believe changing the alert for confirm and setInterval for setTimeout, as code below solve your problem. function session_checking1() { $.post( "./alertaposicionamento2", function( data ) { if…
javascriptanswered Benilson 426 -
1
votes1
answer34
viewsA: Is it possible to remove or change an html element and keep your kids with javascript?
It’s possible, follow the code: var father = document.getElementsByClassName('father')[0], //grandson = document.getElementsByClassName('grandson'); // descomentar essa linha e comentar a de baixo…
-
2
votes2
answers154
viewsA: Is there a rule for "type statements in class properties"?
A contribution less complete than Maniero’s, but one that I believe should be taken into account. If you want to avoid unwanted trips to the database, you can use the infamous Singleton, I will not…
-
1
votes1
answer43
viewsA: Jquery POST with pause in sending
Perhaps this is one of the few cases where synchronous ajax requests should be used: $.ajax( { url: "https://url.com.br/arquivo.php", type: 'POST', async: false, // define que pára tudo até a…
-
0
votes1
answer302
viewsA: Onbeforeunload on Google Core, any hiccups?
You will find several responses discouraging this practice, because the user can turn off the computer, lack light, etc. But I use a solution that works well for me, search by Navigator.sendBeacon…
-
0
votes1
answer24
viewsA: Variable with temporary file path loses value in Function
Set the function setting before the switch and with parameters and use the parameters in the function call: function lePlanilha($arq, $extensao){ echo "Nome: " . $arq . " - Extensão: ". $extensao .…
-
0
votes2
answers110
viewsA: Using the for command in Javascript
You have to declare the function before the go and call it as code below: function imprimirAzul4() { return "Azul"; } for (var i = 0; i < 4; i++) { imprimirAzul4(); } Or puts the for inside the…
-
0
votes1
answer47
viewsA: Error in php url
The first URL parameter has to be passed with ? (interrogation) the others are passed with & (and commercial). Example: www.algumacoisa.com.br/index.php?…
-
1
votes1
answer177
viewsA: Function Return Java Script
The problem is the scope of the result, it is inside a function that is inside another function that is being called by another function, follows an example of code in which getCont happens to have…
-
2
votes2
answers69
viewsA: How to show only the records exactly the same as those typed?
Taking as an example one of your queries: $sql = "SELECT id,palavra from interpretacao_cpp where pronta != 0 AND palavra LIKE '".$letter."%'" ; Placing limit of 5 results, using the limit: $sql =…
-
0
votes2
answers32
viewsA: Graphic with SVG
Well, I hope it helps by testing your code, I didn’t notice the graph coming out of the div, just getting bigger than it, tangent to the height, if that’s the problem, you can solve it with the…
-
6
votes2
answers95
viewsA: Search Duplicity in the table
You can do Join using the same table with different aliases, follow the example: SELECT t1.PARCEIRO, t1.TELEFONE FROM tabela as t1 JOIN tabela as t2 /* mesmo telefone */ ON t1.TELEFONE = T2.TELEFONE…
-
-1
votes2
answers860
viewsA: CSS class change another CSS class
You can use !Important to set the priority and ignore whether the class is subsequent or not, as an example: .tres { background: blue !important; }