Posts by Diego • 4,520 points
159 posts
-
2
votes2
answers614
viewsQ: How to make a Select to not show reset result?
I have the select below, which always brings me two lines, one with zero and the other with value: SELECT COUNT(DISTINCT ROMANEIO) ROMANEIO FROM PCN_ROMANEIO_DISTR_ITEM WHERE USUARIO = 'junior'…
-
3
votes1
answer1479
viewsQ: Query with random result
I have the query below, used in an internal routine, for distribution of items for separation in data collectors: Select distinct IP, USUARIO, DATA from PCN_ROMANEIO_ACESSO PRA Where pra.STATUS =…
-
4
votes2
answers6624
viewsA: Using PING with PHP
I edited the command exec, adding the following: exec("ping -n 1 -w 1 " . $host, $output, $result); That way, in addition to buying time, the result became correct.…
-
5
votes2
answers6624
viewsQ: Using PING with PHP
I have a function that needs to drip 5 machines on the internal network. I am using the command below: //EXECUTA O PING exec("ping " . $host, $output, $result); What happens is this. If I put any ip…
-
0
votes0
answers54
viewsQ: Ajax does not work in IE6
I have Ajax below, which works normally in Chrome, Firefox (no error in Firebug) and Opera: /** * Função para criar um objeto XMLHTTPRequest */ function CriaRequest() { try{ request = new…
-
3
votes1
answer91
viewsQ: PHP date_diff error
I am doing a test, with a query in Oracle database (recording sysdate, result: 13/09/2016 13:24:44) and returning me in PHP. I need to calculate the difference in hours and was trying the function…
-
1
votes1
answer394
viewsA: Ignore group date/time field by
For record. I decided to create a subquery, taking the last date (max). This way, met what I needed: Select msi.segment1 codigo, msi.description descricao, pcn1.quantidade Qtde_Romaneio,…
-
1
votes1
answer394
viewsQ: Ignore group date/time field by
I have the following query: Select msi.segment1 codigo, msi.description descricao, pcn1.quantidade Qtde_Romaneio, nvl(SUM(pcn2.quantidade),0) Qtde_Coleta, (nvl(sum(pcn2.quantidade),0) -…
-
1
votes4
answers541
viewsQ: Concatenate 2 PHP variables into SQL statement
I am developing a PHP system with Oracle and to "optimize" an update, I would need to concatenate a variable (with values from 1 to 3) in the name of the variable that I will pass in the…
-
1
votes1
answer47
viewsQ: Onclick point to function with $_SERVER
Due to an obscure need of the system, when clicking a button, I need to know the IP that triggered it to direct the correct page. With $_SERVER['REMOTE_ADDR'] I have this information. But how could…
-
2
votes1
answer3064
viewsQ: Send form data by array to PHP
Due to a system need we are working on, I need to send 3 fields as an array to a PHP. Example: <input type="text" name="name[]" /> <input type="text" name="name[]" /> <input…
-
2
votes1
answer118
viewsA: Release Input by clicking Select
You can use to adapt the Ajax below for this. Remember if by id and name in the fields: <script> $(document).ready(function() { $("#div_para_ocultar").hide() $('#tipo').on('change',function(){…
-
4
votes1
answer189
viewsA: Delphi - Date Comparison Error
Possibly there is "confusion" in the now, which contains hour/minute/second and in the field armanezado can be any other value. To solve, you can use the command trunc: if trunc(data) <…
-
3
votes1
answer672
viewsQ: Generate Apache logs in different files
I have a VM running a single PHP project, only so far with external access released. Last week I needed to create a folder inside the www with the signatures of the employees' emails, and the log…
-
2
votes1
answer129
viewsA: Run a program rdp by a PHP application
You can create a . bat file by pointing to your program. In PHP, use this code: $handle = popen('meu_bat.bat', 'r'); $read = fread($handle, 2096); pclose($handle); And within the meu_bat.bat place…
-
1
votes1
answer94
viewsQ: Oracle SQL Error Invalid Number
I have the query below, which shows me date and time, saved as default sysdate oracle: SELECT TO_CHAR(DATA, 'DD/MM/YYYY hh24:mi:SS') D1, TO_CHAR(DATA_FIM, 'DD/MM/YYYY hh24:mi:SS') D2 FROM…
-
0
votes1
answer190
viewsA: Ajax play audio after running successfully
Solved as follows (FF, Chrome, Opera): // Verifica se o Ajax realizou todas as operações corretamente if(req.readyState == 4) { if (req.status == 200) { // Resposta retornada pelo…
-
3
votes1
answer190
viewsQ: Ajax play audio after running successfully
I need to play an audio in the execution of the excerpt below, where it displays the data found in a query: // Verifica se o Ajax realizou todas as operações corretamente if(req.readyState == 4) {…
-
7
votes1
answer293
viewsQ: How do I prevent caching Ajax requests in IE 6?
I have the code below, to update a DIV on a page: var req; // FUNÇÃO BUSCA ROMANEIOS PARA EXIBIR NA TELA DE MENU. function buscarRomaneio() { // Verificando Browser if(window.XMLHttpRequest) { req =…
-
0
votes1
answer249
views -
4
votes2
answers1104
viewsQ: Oracle SQL result ordering
I am done the query below, which was ordered by the date of creation of the product batch. With the migration of version 11 to R12 of Oracle, the batch creation field became the migration date, that…
-
3
votes5
answers29127
viewsA: use if in sql server
In a nutshell: You can use the function CASE: SELECT CAST( CASE WHEN Obsolete = 'N' or InStock = 'Y' THEN 1 ELSE 0 END AS bit) as Saleable, * FROM Product Here has several examples and explanations.…
-
1
votes1
answer6742
viewsQ: Enter user and password in bat file
I have a. bat file that automatically copies files from one server to another. We are updating the environment and this server will be modified and when testing . bat I received the following error:…
-
13
votes1
answer8659
viewsA: What is the purpose of stdClass in PHP?
Stdclass is a predefined PHP class. It is empty, meaning it has no methods or properties. But what is the point of this? It is the default class of undeclared objects, that is, when you convert an…
-
3
votes2
answers720
viewsA: Replacing "NAN" with 0 in Javascript
You can do: a = a || 0 ...that will convert any "falsey" value from a to 0. Values "falsey" are: false null Undefined 0 "" ( Empty string ) Nan ( Not a Number ) Or so if you prefer: a = a ? a : 0;…
javascriptanswered Diego 4,520 -
14
votes1
answer10637
viewsA: Thread Safe(TS) and Non Thread Safe(NTS) - What are they, what’s the difference?
From the PHP documentation: Thread Safety means that the binary can work in a context of multi-segment server such as Apache 2 in Windows. Thread Safety works by creating a local storage copy in…
-
0
votes2
answers142
viewsA: How to bring date without Sql server 2008 record
Would that be? SELECT DATA, COALESCE(SUM(VALOR),0) FROM TABELA1 WHERE CONTA = '176087' GROUP BY DATA
sql-serveranswered Diego 4,520 -
2
votes1
answer59790
viewsA: how to use the POW (POTENCY) function in C
The line has a syntax error: cf = (pow(cf,num_parcelas)); Where: pow(base, expoente);
-
4
votes2
answers6419
viewsQ: Run PHP script in Windows task scheduler
I have a PHP script that I currently leave running with an open browser, with the command below: <meta HTTP-EQUIV="refresh" CONTENT="1800"> Despite the mémoria problems that the browser…
-
3
votes4
answers473
viewsA: DNS redirection - Problem AWS service usage
With . htacess also you can adjust this: RewriteEngine On RewriteCond %{HTTP_HOST} !^$ RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^…
-
0
votes2
answers91
viewsA: Query mix of oracle products
Your question is very generic, but I believe that with the query below you can adapt to your use. Basically, in my case, it lists the loads(cameras) and your tax bills(source, connectors). Note the…
-
0
votes2
answers806
viewsA: How to create an animated Hover icon
Behold here o Hover.css. It is a package of several icons with this effect. Download the package it has the instructions on how to use, it is very simple.…
-
1
votes1
answer312
viewsQ: Variable does not work in paging
I am trying to build a pagination on a report that I own, but I have the following problem. There is the variable $situacao, which comes via POST, which is necessary for the generation of the…
-
3
votes2
answers369
viewsA: include with html file
Try it this way: <table align="center" border="1"> <tr> <td> Nome </td> <td> Idade </td> <td> Peso </td> </tr> <tr> <td> <?php…
-
6
votes1
answer13579
viewsA: Calculate time difference in php
I did it this way and it worked correctly: //Calcula o tempo de upload $entrada = $horario1; $saida = $horario2; $hora1 = explode(":",$entrada); $hora2 = explode(":",$saida); $acumulador1 =…
-
6
votes1
answer470
viewsQ: Progress bar does not charge
I have the code below, which feeds a progress bar while uploading the file. What happens is the following: In some browsers, like Chrome and Opera, it works normally. Not in Firefox and Safari.…
-
1
votes2
answers49
viewsQ: Input file type as read-only
I am trying to set as read-only an input file type when clicking on Ubmit, but the way below did not work. Any suggestions? <script> $(document).ready(function() { $("#salvar").on('click',…
-
0
votes0
answers405
viewsQ: Move_uploaded_files() does not pass the file
I’m putting together a file-exchange system here for the company, but I’m making a strange mistake, to say the least. Some files, mainly PDF, it doesn’t even pass to the SalvarArquivo.php. The…
-
4
votes1
answer274
viewsQ: SQL return in different columns, not rows
I am testing a query, where I would need the returns to come in separate columns, but the way below it returns in rows. I tried to use LEFT JOIN but the syntax didn’t work. select u.nome_completo AS…
-
3
votes1
answer1596
viewsQ: Open page by clicking Ok - Sweetalert
I’m doing a test with the plugin SweetAlert, and would like to open a page by clicking on ok, but I couldn’t do. I ran a test using setTimeout, but she got a lot of wind... <html> <head>…
-
3
votes3
answers2130
viewsA: Close page when printing
For the record, I decided as follows: <body onload="ClosePrint()"> Function: function ClosePrint() { setTimeout(function () { window.print(); }, 500); window.onfocus = function () {…
javascriptanswered Diego 4,520 -
3
votes3
answers2130
viewsQ: Close page when printing
I have the following situation: When confirming the opening of a call, in the confirmation directs to the printing page. When clicking, it already displays the print option, thus: <body…
javascriptasked Diego 4,520 -
2
votes1
answer2742
viewsA: Problem with php special characters
Check your bank to see if you are recording the information correctly. If so, change this: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> For that reason: <meta…
-
0
votes1
answer366
viewsA: How to customize the attach file button in aspx
This is not technically possible, for security reasons. If not, the user could be "tricked". However, there are other methods to solve this, although these require working with pure HTML instead of…
-
3
votes1
answer875
viewsA: Rewrite module in . htaccess for subfolders
You will have to create another .htacess, save it in the folder adm and change the second and last line: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /adm RewriteRule ^index.html$ -…
-
2
votes1
answer47
viewsQ: Input does not load disabled style
I’m editing a few input, select and textarea, removing the "standard" style, but I’m having a problem. When he’s like disabled, should appear with a dark background. But it appears in white color,…
-
3
votes1
answer2080
viewsQ: Change default font
I am trying to change the font of a page I am mounting with bootstrap, but for some reason it does not accept. I made the following steps: In HTML: <link…
twitter-bootstrapasked Diego 4,520 -
3
votes4
answers24789
viewsQ: Menu and submenu with bootstrap
I’m trying to add a sub-item below about but I’m not getting it. I tested with the tags ul and li, but it didn’t work. <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">…
bootstrap-3asked Diego 4,520 -
2
votes1
answer699
viewsA: Popup in PHP after return Success
Elementary, my dear Watson: [..] $header = implode("\r\n", $headers); if (mail($to, $subject, $message, $header)) { ?> <script language="JavaScript"> <!-- alert("Sucesso!");…
-
3
votes1
answer2845
viewsA: Remove Duplicate Space in Middle of String
Basic Concepts Trim: Remove all whitespace independent of position (Left or Right) from the desired field. Ltrim: Remove the white spaces that are to the left of the desired field. Rtrim: Removes…