Posts by Luis Henrique • 3,693 points
78 posts
-
1
votes2
answers880
viewsA: Duplicate value in table. How to remove?
You can mount a subselect inside the delete by selecting lines whose sq_candidato are repeated: delete from candidatos where id in( select candidatos.id from candidatos inner join candidatos c on…
-
3
votes3
answers12476
viewsA: Display data in a foreach table
What you’re doing wrong is that foreach iterates over an array and the return of its method calculaAprovacao is a Boolean. If you want to use it this way, you will need to create an array within the…
-
2
votes1
answer387
viewsA: Drawing through a . txt
First, you have to define the variables hairX and hairY as static: static int[] hairX = new int[15]; static int[] hairY = new int[15]; So just call the function leituraArquivo2D passing the required…
-
12
votes2
answers1064
viewsA: What does << in PHP mean?
The operator << not only in php, but in several other languages, it is a Bit-a-bit operator. What it does is shift the value to the left of the n times operator, where n is the value to the…
phpanswered Luis Henrique 3,693 -
8
votes1
answer8435
viewsA: Uncaught Referenceerror: $ is not defined
Your input syntax for scripts is wrong. There is no attribute href for the script tag, but yes src. Replace the inclusions with: <script type="text/javascript"…
-
3
votes2
answers1534
viewsA: How to remove blank line "Return"
You are running the loop only once, so it overwrites only the direct occurrences of \r\r, but when removing one of the Returns what remains concatenates with the next. Change your code snippet to:…
-
2
votes2
answers4617
viewsA: Querysyntaxexception: Unexpected token: . near
Your query is wrong, the word is missing where in it. select c from Cidade where c.estado = :est
-
1
votes2
answers59
viewsA: Create id’s dynamically
This happens because the id selector jQuery internally uses document.getElementById, thus returning the first and/or single element corresponds to such id. If you want a list, you have to use the…
-
0
votes2
answers480
viewsA: Load checkbox from select
Just compare the valor_selecionado which you get with the value you want, in this case 3. And in case it is the value, pass the visibility = visible // Selecionamos o menu dropdown, que possui os…
-
1
votes4
answers57975
viewsA: How to clear html form fields?
In Jquery there is no reset method, but you can call the javascript native: $('form').submit(function(){ $(this)[0].reset(); });
-
5
votes1
answer81
viewsA: Problems with a MYSQL query - Categories and Items
Replace the INNER JOIN of your query by a LEFT JOIN. When there is no value in the table to the right, it will still bring the result of the table to the left with the null values to the right. To…
-
2
votes1
answer105
viewsA: Replace String in Mysql
Use the function REPLACE mysql: SELECT REPLACE(filiais, "\"", "\'") FROM bancos WHERE ativo = 1 The first parameter is the column in which the function will be executed, the second is the old…
mysqlanswered Luis Henrique 3,693 -
5
votes1
answer54
viewsA: How to organize Bdados results
The way you are doing, you will need to concatenate the HTML into the php file. <?php $conecta = mysql_connect("127.0.0.1", "root", "") or print (mysql_error()); mysql_select_db("bd", $conecta)…
mysqlanswered Luis Henrique 3,693 -
0
votes2
answers560
viewsA: Select 2 related and 1 unrelated tables in a query
You can join in the table agenda_saidas without specifying junction condition, since the table has no relation. But this will cause a crossing n x m (all lines with all lines), ie, will duplicate…
-
2
votes1
answer60
viewsA: I want to remove everything after searching with jQuery
Follow two solutions: Using split, but you have to insert the Buscar again: var url = window.location.href.split("Buscar")[0] + "Buscar"; Using regex: var url =…
jqueryanswered Luis Henrique 3,693 -
2
votes3
answers42
viewsA: Formatting problem when injecting date into datetime attribute
You are not opening and closing the quotes correctly for id and datetime, as they conflict with the append statement. Replace the quotation marks (") by apostrophes ('), or add a bar (\) every quote…
-
1
votes3
answers461
viewsA: Make a cascaded Else inside a for
From what I understand what you need is this, within each block you put the rest of your code. for (int i = 0; i < vlstDados.Count; i++) { vstrNmPessoa = vlstDados[i].NmPessoa; if…
c#answered Luis Henrique 3,693 -
3
votes3
answers1446
viewsA: Specify fields I don’t want in Mysql
You can use the following select: SET @sql = CONCAT('SELECT ', (SELECT REPLACE(GROUP_CONCAT(COLUMN_NAME), '<columns_to_omit>,', '') FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME =…
-
2
votes2
answers5553
viewsA: Clear inputs inside form after sending the message
Simulate the click on the button after the form is sent by ajax. $.post('carregamentos/contato.php', $('#contatoFormulario').serialize(), function(abc) { alert('Sua mensagem foi enviada com…
jqueryanswered Luis Henrique 3,693 -
3
votes4
answers146
viewsA: sql - SELECT for recent data only
I believe something like that solves your problem: SELECT backup, bytes, MAX(data) FROM table_name GROUP BY backup
-
2
votes2
answers938
viewsA: Insert the json return inside Divs separated by <div> </div>
You are always inserting in the same div, so the content is being overwritten. Do something like: <!-- DIV que vai receber as informações --> <div class="conteudos"> <div…
-
6
votes2
answers441
viewsA: Recreate tables without dropping
Run a query to change the table: ALTER TABLE [table-name] ALTER COLUMN [column-name] [type] NULL
-
2
votes1
answer854
viewsA: List-based WHERE filter with SQL
A viable solution is the use of the clause IN, where it will bring all the corresponding results to the values passed by parameter. Ex: SELECT * FROM NotasFiscais WHERE CFOP IN('5101', '6101', ...)…
sqlanswered Luis Henrique 3,693 -
10
votes5
answers17262
viewsA: How to use ajax and php to call a function in php?
You can pass the variables to php using the property data ajax and then in php itself check and make the function call: Ajax: $.ajax({ type: 'post', url: 'geraSenhaProvisoria.php', data: {…
-
0
votes1
answer261
viewsA: Disable checkbox
When clicked, use the property checked same to set the property disabled of the other checkboxes, making a find on them. It is worth mentioning that one should use the opposite of the Boolean value,…
-
1
votes1
answer94
viewsA: See table row and "ranking"
You can bring this column already from SQL. Just create a temporary column with auto increment and make an order by user_views. Follow an example in Mysql: SELECT (@count := @count + 1) AS ranking,…
-
3
votes2
answers4972
viewsA: How to make a form with date field? (DD/MM/YYYY)
I suggest using the plugin datepicker of jqueryui: http://jqueryui.com/datepicker/ Code example: // Cria-se um input padrão com um id para identificar ele <diva>Data: <input type="text"…
-
4
votes3
answers612
viewsA: How to leave empty textbox after an Ajax request via Post?
You can do a function to clear the form and call it on success ajax: function limpaForm(){ $("#Pessoa").val(''); $("#Cep").val(''); $("#Endereco").val(''); $("#Numero").val('');…