Posts by Nelson Aguiar • 710 points
29 posts
-
2
votes2
answers42
viewsA: How to Update in 3 lines in a query
Headlines use in() in your Where clause, example: UPDATE table1 SET Ordinal = 'º' WHERE id IN (13,14,15), Ref:https://docs.microsoft.com/pt-br/sql/t-sql/language-elements/in-transact-sql…
sql-serveranswered Nelson Aguiar 710 -
1
votes2
answers1791
viewsA: Catch string inside PHP div
Use the strip_tags() function along with Trim(), it removes String Ex tags: $out = trim(strip_tags($qtd)); var_dump($out); The output will result in: string(21) "435 itens encontrados" If you want…
phpanswered Nelson Aguiar 710 -
1
votes2
answers517
viewsA: How to join two array
You can use the array_map, it applies the callback function for each element of the Ex array: $resultMerge = array_map(function($a,$b){ $b->nome = $a; return $b; },$array1,$array2); If you want…
-
3
votes1
answer13964
viewsA: IF condition inside an Oracle SELECT
In select you can use CASE Ex: SELECT CASE WHEN CAMPO1 IS NULL THEN 'CAMPO1 NULL' ELSE CAMPO1 END AS CAMPO1, CAMPO2, CAMPO3, CAMPO4, CAMPO5 FROM TABELA1 WHERE CAMPO1 = dado1 AND CAMPO2 = dado2 If I…
-
1
votes1
answer761
viewsA: How to pass range type input form values for Javascript defined variables to perform conditions?
Guy gives you to scroll through the inputs to make the sum this way: var total = 0; $('input[type=number]').each(function() { //number devido ao código gerado pelo jquery mobile. total +=…
-
0
votes1
answer151
viewsA: Pick element selector created at runtime
I don’t know if I understand very well, but you can leave the buttons with the same name and add the id you want to pick up, in the case there you were leaving the id’s equal which is not correct,…
-
0
votes4
answers2413
viewsA: Generate angular pdf using javascript
You can do it this way: creation of Resource: var app = angular.module('app', ['ngResource']); app.factory("PDFResource", function ($resource) { return $resource("REST_API.url +…
-
1
votes3
answers14892
viewsA: function $.Ajax() return value?
The use of synchronous ajax requests is discouraged, probably on your console will come out something like this: Synchronous xmlhttprequest should not be used on the main thread due to its…
-
3
votes2
answers2015
viewsA: Simple equation of division in java
There are two ways to solve this: double total = (90/112d) * 100 ; System.out.println(total); Or: double total = (90./112.) * 100 ; System.out.println(total);…
javaanswered Nelson Aguiar 710 -
2
votes2
answers133
viewsA: Return div to previous style, after changing style, only with javascript
Both in your first if and if you pass the test, you can change the style properties of the element with setAttribute this way: //Esse de acordo com o seu código no caso falha.…
javascriptanswered Nelson Aguiar 710 -
1
votes2
answers4580
viewsA: PHP - How to compare a date that comes from the Mysql database to the current day?
Actually just remove strtotime from the variable $Today: <?php $dtEntrega=date("Y-m-d",strtotime($row["dtEnterga"])); $today = date("Y-m-d"); if($today>=$dtEntrega){ echo ' alguma coisa'; }…
-
1
votes1
answer111
viewsA: How to pass data to a new line created by javascript
That way I believe it works: var linha1 = document.getElementById("tabela").insertRow (-1); linha.setAttribute('class', 'row'); linha.setAttribute('onclick','editar(this)'); If you want to put in a…
-
0
votes1
answer84
viewsA: Trigger cursor in book allocation
If your goal is only to add the return prediction date, you don’t have to use a cursor, just make your Rigger be triggered before the Insert, because in the update you won’t do it because the date…
-
0
votes1
answer588
viewsA: backup of specific mysql content data via java
To backup a specific table you have to pass after the database name the table name ex: public static void makeBackup() throws IOException{ String caminho = "C:\\Program Files\\MySQL\\MySQL Workbench…
-
1
votes2
answers2108
viewsA: Create Bootstrap template to be used on all JSP pages of your Java app, implementing only "content/content"
You can also use Taglibs, just add in the WEB-INF folder a folder for the content you want to create and then go adding small files with the tags themselves example: Create WEB-INF folder/tags:…
-
1
votes1
answer2150
viewsA: Phpexcel, select sheet when importing data to mysql
To work on tabs or Sheets, as you prefer, you should use, remembering that the indexing of tabs start at 0: $objWorksheet = $objPHPExcel->getSheet(1); or alternatively however less productive in…
-
1
votes2
answers484
viewsA: Global variables do not update in the view with Angularjs
Do it that way $routeProvider.when('/contatos',{ templateUrl: '../partials/contatos.html', controller: 'ContatosController' }) You have to inform the controller and not the.js file.…
angularjsanswered Nelson Aguiar 710 -
0
votes2
answers260
viewsA: Delete file (photo) from folder when performing update
If you have the image or file path just do: File imagem = new File("path/da/imagem"); imagem.delete(); .delete() => boolean return. I hope it helps.
javaanswered Nelson Aguiar 710 -
1
votes1
answer621
viewsA: Handle query postgres errors
As you want to implement this in catch block, first thing is to change the PDO error control strategy, there are 3 strategies PDO::ERRMODE_SILENT - to obtain errors via errorcode and errorInfo;…
-
3
votes2
answers382
viewsA: Filter SQL query
A roughly speaking in PHP would be more or less what you would do as the return of the database <?php $retorno="Prezado Cliente…
-
2
votes1
answer724
viewsA: How to use Pattern to delimit a minimum number in an input text?
That will probably solve. <input type="text" name="someName" id="someId" required="required" pattern="((^[5-9]$)|(^[1-9][0-9]?[0-9]$))"/> Test HTML in jsfiddle.net Explanation of the…
-
3
votes1
answer778
viewsA: Implement Filter Access Control - JSP
First you have to put the annotation in the class or configure the filter in web.xml, also remember that the class has to implement the Filter interface and consequently the init() Destroy() and…
-
5
votes1
answer949
viewsA: Calculate date time in mysql
Have you tried using TIMESTAMPDIFF(Unit, datetime1, datetime2)? It returns the subtraction of datetime2- datetime1 and Unit may be SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR follows…
-
0
votes1
answer241
viewsA: $Conditional Room at Angle
You can use a single ng-click function and check which radio was clicked through $Scope this way: <div class="row"> <div class="col-lg-10 col-lg-offset-5"> <label…
-
2
votes1
answer131
viewsA: Insert with select from two different places
Guy in the first Insert if you use the returning it will already return the code of the guy inserted. Ex: insert into tabela(nome, etc) values('fulano', true) returning id; assuming your primary key…
mysqlanswered Nelson Aguiar 710 -
1
votes1
answer28
viewsA: Explanation of a php array and how to access the x position of the PHP array
well there in case you have a variable time and not an array. to be array should have done <?php $count=0; while ($arrayDisp = mysql_fetch_array($result){ $count=$count+1; $hora[] =…
phpanswered Nelson Aguiar 710 -
5
votes2
answers1211
viewsA: Passing data between Activity Android
If you are going to use only the Bundle / Intent only once will do, now if you want to keep them and recover later on any Sharedpreferences use SharedPreferences pref =…
-
1
votes0
answers346
viewsQ: Angular overall function
Good morning guys, I don’t work much with front-end and I started using angular with bootstrap a little while ago my doubt is this: I have a div for message presentation, error, success; To change…
angularjsasked Nelson Aguiar 710 -
1
votes2
answers5194
viewsA: What is the purpose of the "persistence.xml" file?
Persistence.xml is a file for JPA configuration, Hibernate is one of the implementations, either for Hibernate or another JPA implementation if it is necessary to use this file, I do not know what…