Posts by Pedro Luzio • 1,209 points
61 posts
-
1
votes2
answers244
viewsA: Adding more input with jQuery
I got it this way, but no JQuery function gera(){ var x = document.getElementById("qt").value; tab=document.getElementById("tables"); tab.innerHTML=''; for(i=1; i<=x ; i++) {…
jqueryanswered Pedro Luzio 1,209 -
0
votes1
answer161
viewsQ: C# foreach aborted
When I try to move the controls of a FlowLayouPanel to another flpPropriedades -> flpReserva through a loop foreach he leaves in the middle and does not complete the transition. foreach (Control…
-
0
votes1
answer161
viewsA: C# foreach aborted
The solution found was to cycle do...While: do { flpReserva.Controls.Add(flpPropriedade.Controls[0]); } while (flpPropriedade.Controls.Count != 0);
-
1
votes3
answers268
viewsA: String string.fromCharCode()
The simplest way in this case is to do three cycles for chained, however due to the large number of results (1 092 727) will become a little slow... in the test I did took 28,75s var str=''; s= str;…
javascriptanswered Pedro Luzio 1,209 -
2
votes1
answer509
viewsA: How to highlight a menu item when clicking Back or Next
You can do it like this, use the function muda(num), which receives 1 or -1. var id; function Selecionado(tag,thisid){ id=thisid; var item = document.getElementById('menu'); var link =…
-
8
votes2
answers2547
viewsA: How to get out of a cycle in C#?
To exit the cycle use the command break foreach (DataGridViewRow dr in dgvValetes) if (dr.Cells["valor"].ToString()=="1") break;
-
3
votes1
answer588
viewsQ: My software is being blocked by Windows Smartscreen
I am developing a software and, while testing the executable on another computer gave me this message from Windows Smartscreen. I don’t know what it’s about, I’ve done some research and I haven’t…
-
1
votes2
answers46
viewsA: Error using Inner Join in MYSQL
Your first Inner Join refers to a table that is only called in the second Inner Join... Try it this way: SELECT EXP.experiencia, AEP.altura, AEP.peso, PRAN.tipo_prancha, PRAN.tamanho_prancha,…
-
1
votes3
answers176
viewsA: SELECT in two tables, with ID separated by comma
Try it this way: select tbl_mesa.id, tbl_cores.cor from tbl_mesa inner join tbl_cores on ',' + tbl_mesa.cores + ',' like '%,' + cast(tbl_cores.id as nvarchar(20)) + ',%'…
-
0
votes2
answers354
viewsA: Update command does not update table
In the mysql_query you are using variables inside the text string, you have to send them as such: mysql_query ("update time set…
-
6
votes2
answers109
viewsA: Store values in Hashtable
When you re-turn a Hastable value you have to convert it to String like this: string tipo = ht["tipo"].ToString();
-
2
votes1
answer106
viewsA: Use variable in 2 php files
Just do it like this: Filer1.php <?php $server = "127.0.0.1"; $banco = "Crud"; $usuario = "root"; $senha = ""; ?> Filer2.php <?php include 'Ficheiro1.php'; $conexaoDB =…
-
5
votes2
answers4855
viewsA: How Select SUM(',''',''''')
Just imagine your example: SUM(IF(debito_credito_financeiro = 'D', valor_financeiro, 0)) AS debito, The syntax is IF(condition, return if true, return if false) That is, if debito_credito_financeiro…
-
1
votes1
answer28
viewsA: Mysql ambiguous error
It happens because you have the WHERE id_cliente = '8', you have to put WHERE cad_cliente.id_cliente = '8'. 'Cause he’s messed up and he doesn’t know which one you’re referring to…
-
2
votes3
answers331
viewsA: Return setInterval Value
You have to declare the cont variable as the global variable, because the value that the function takes is the range ID... i=0; var cont=0; setInterval(function () { cont = i++; }, 800);…
javascriptanswered Pedro Luzio 1,209 -
1
votes3
answers552
viewsA: Text registration with emoticons
For that you have to keep your comic book as utf8mb4 in Mysql: SET NAMES utf8mb4; ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; ALTER TABLE table_name CONVERT TO…
-
4
votes2
answers1341
viewsA: With setting the deadline in the bootstrap datepicker?
You gotta appreciate the endDate. var today = new Date(); $('#data-solicitacao').datepicker({ endDate: new Date(today.getFullYear(), today.getMonth(), today.getDate()) })…
-
3
votes3
answers2889
viewsA: Get Defined/Current Time Difference
day = new Date("Thu May 19 2016 05:00:00 GMT-0300"); today = new Date("tue May 23 2016 09:00:00 GMT-0300"); document.write(diferencaDias(day,today)); function diferencaDias(data1, data2){ var dif =…
-
1
votes1
answer83
viewsA: Attribute required in input text javascript
For that, then put the instruction: local.required=true;
javascriptanswered Pedro Luzio 1,209 -
1
votes3
answers1598
viewsA: How to create a FUNCTION to format currency in POSTGRE?
You can do it like this: Select to_char(123.45, 'L9G999G990D99'); L - Currency symbol D - Decimal point 9 - Numbers G - Unit separator I hope I’ve helped.…
postgresqlanswered Pedro Luzio 1,209 -
2
votes3
answers82
viewsA: Javascript - Function problem that adds textbox
In this case you should use the function .append since every time you did the +=, for him it was as if you were giving a completely new html. var x=1; $("#addPart").click(function(){…
-
1
votes2
answers38
viewsA: Function to form hours
You have to present it in Datetime format, otherwise it takes the zero, because a zero on the left doesn’t count. function converter($time) { if (is_int($time)) { $horas = floor($time / 3600);…
phpanswered Pedro Luzio 1,209 -
2
votes3
answers47
viewsA: Problems with the positioning of an element
You have to put the display:inline-block and float on the right. .descricao_noticia{ width:80%; display:inline-block; } .data{ text-align:right; display:inline-block; float:right; } <div…
-
1
votes1
answer41
viewsA: Facebook dependency for authentication
I think you do, because when you log in with the facebook account, it uses an SDK to do it. The PHP session is a Facebook session, so yes, you will no longer have access. But there are certain…
-
1
votes3
answers419
viewsA: How to turn a bool into int?
if(_TextValPalite.Enabled) { if (Convert.ToInt32(_TextValMin.Text) && Convert.ToInt32(_TextValMax.Text) != Convert.ToInt32(_TextValPalite.Text)) { MessageBox.Show("Você não pode fazer…
-
1
votes2
answers585
viewsA: How to change Checkbox with Dropdownlist onChange in ASP.NET MVC Table?
No Jquery, Pure Javascript Only. function check() { document.getElementById("red").checked = true; } function muda(){ for(var i=0;i<document.getElementsByName("letras").length;i++)…
-
1
votes2
answers80
viewsA: Hide videos in safari iframe
This is the way I usually do and never gave me any trouble. function toggleVideo(state) { var div = document.getElementById("vid"); var iframe = div.getElementsByTagName("iframe")[0].contentWindow;…
-
8
votes1
answer435
viewsA: C# IF simplification
You can use a ternary operator to validate nud_qtPedida. You can start by doing like this: decimal per=nud_qtPedida.Value !=0 ? nud_qtFornecida.Value * 100 / nud_qtPedida.Value:0;…
-
2
votes4
answers8374
viewsA: Change image with CSS Hover
If you’re like display:none it’s like it doesn’t exist, you can do it with Javascript: function muda(){ document.getElementById("imgRestaurante").src="<?php echo $restaurantes_hover; ?>"; }…
-
4
votes3
answers32392
viewsA: Changing window.location.href does not redirect to the new page
When it comes to external links you have to put http:// before the address. function eliminaParagem (){ var confirma =confirm("Tem a certeza que quer eliminar a paragem"); if (confirma==true){…
javascriptanswered Pedro Luzio 1,209 -
1
votes4
answers160
viewsA: How can I make a string code work with > or <?
You cannot compare two Strings as being larger or smaller, and in order for the program to fail when the user doesn’t want to put a character other than a number, you should use NupericUpDown which…
-
-1
votes3
answers1866
viewsA: Bringing Winform Window Forward
For that you have to use the form you want on top as form.ShowDialog()
-
2
votes2
answers91
viewsA: Erasing bottom lines up
For that you’ll have to put visible=hidden and display=none var numeroLinhas=60; function apaga(){ if(numeroLinhas!=0) for(i=numeroLinhas ; i>numeroLinhas-20 ; i--) {…
-
0
votes2
answers40
viewsA: Order of operation of scripts
This happens because you immediately return a false. logo, if the function immediately sends a false to that moment. function valida_form (){ preenchido=true;…
javascriptanswered Pedro Luzio 1,209 -
1
votes3
answers1957
viewsA: Cannot implicitly Convert type 'Object' to 'int'. An Explicit Conversion exists (are you Missing a cast?)
You cannot cast to an object format and try to store in int... You have to do like this with the Convert.ToInt32() { int num6 = Convert.ToInt32(Cupons); foreach (GamePlayer gamePlayer in…
-
-2
votes1
answer36
viewsA: Rand() within the for
In this example generates numbers between 0 and 100, just change the range you want in rand(MIN, MAX) <? for($i=0; $i<=9; $i++){ srand(make_seed());?> <input type="button"…
phpanswered Pedro Luzio 1,209 -
3
votes2
answers824
viewsA: How to save two variables from a JS in php session?
You will need to use Javascript to send the variable to a new link: pagina.php?empresa=1&uni=1 Then on that new page you use $_GET: $_SESSION['V1']= $_GET["empresa"]; $_SESSION['V2']=…
-
4
votes2
answers12794
viewsA: How to create a Mysql database with SQL commands?
It’s easy: You create the database CREATE DATABASE NOME_DA_BASE_DE_DADOS You use the database USE NOME_DA_BASE_DE_DADOS You create the table CREATE TABLE NOME_DA_TABELA ( NOME_DO_CAMPO_ID INT…
-
0
votes2
answers878
viewsA: how to press the button using code, using the same effect as when the user presses
The easy way is like this: Add the action to Button: b1.addActionListener(this); Then you’ll create that action: public void actionPerformed(ActionEvent e) { //O código que queiras } However, in…
-
1
votes1
answer170
viewsQ: How to add query in a Datagridview?
I managed to make Inserts and Updates. I downloaded this file: using System; using System.Collections.Generic; using System.Linq; using System.Text; using MySql.Data.MySqlClient; using System.Data;…
-
1
votes3
answers1636
viewsA: Download Counter
You can do this with PHP and Mysql: $sql = "Select CAMPO from TABELA where PAGINA like 'NOME DA PÁGINA'"; $numero= mysql_query($sql); while ($tipo = mysqli_fetch_array($numero)) { echo: "Nº. de…
-
0
votes2
answers791
viewsA: How to create anchored links and darken all the rest of the page’s content except the intended section?
Only using HTML and CSS can you do something like this with classes: .pontos{ background-color:#000000; } .pontos: hover{ background-color:#999999; }
-
-1
votes2
answers3840
viewsA: How to use dll in Java
Project properties Source Link source Browse Selections OK https://www.youtube.com/watch?v=y-crjnetpdo…
-
0
votes4
answers306
viewsA: How to link to table?
You’ll have to put a href around the <td> echo "<a href=\"link\"><td>" . $row['id'] . "</td></a>";
-
1
votes1
answer583
viewsA: Foreign keys in database modeling
The primary key of the Profits table can be foreign/external key of other tables, in this case you have: Billing PK->codFaturamento FK->codLucro Profits PK->codLucro Expenses…
-
4
votes1
answer406
viewsA: Operator "?" in PHP, what is it for?
It’s called the ternary operator. This means: if the value of $debit is less than or equal to one, the variable $money gets the value of FALSE, otherwise it gets the value of True. This can be…
phpanswered Pedro Luzio 1,209 -
0
votes1
answer59
viewsA: Fill in form with customer ID
inp.addEventListener("id", function () { //chamada da função que vai preencher os campos }, false);
-
1
votes1
answer62
viewsA: PHP Database Search
Note that you in your SQL query was wrong and were writing HTML inside PHP! Try it this way: <?php include("connection.php"); mysqli_set_charset($con,"utf8"); ?> <tbody aria-live='polite'…
-
0
votes1
answer93
viewsA: C# Floating Form
I decided by adding 10 pixels to the mouse position: private void portaSwitchUpLink_MouseEnter(object sender, EventArgs e, string idPorta) { DataSet ds = _db.consulta("portaSwitchUpLink", "select…
-
0
votes2
answers5572
viewsA: Connect application to Postgresql?
Here it is: string serverdb = "IP"; dbdb string = "Basedata"; string userdb = "Username"; string passdb = "Password"; string connectionString = "Server=" + serverdb + ";Port=5432;UserID=" + userdb +…