Posts by Geraldão de Rívia • 940 points
64 posts
-
0
votes1
answer58
viewsQ: Behaviorsubject does not accept initial value equal to null
I have the following service, however, it is not accepting that I set it to null start pro Subject, keeps returning the error: Argument of type 'null' is not assignable to parameter of type…
-
1
votes1
answer247
viewsA: Passing arguments to python . exe with cx_Freeze
It was just the way I was calling :p Needs to be: ola.exe teste1 teste2
-
1
votes1
answer247
viewsQ: Passing arguments to python . exe with cx_Freeze
I have this code to test the script passage ola py. import sys for arg in sys.argv: print (arg) print ("Hello World!") setup py. from cx_Freeze import setup, Executable setup( name='Ola',…
-
3
votes1
answer214
viewsQ: Checking crashed tables in Mysql with PHP
Here in the company there is a structure with at least 20 servers, each server has at least 20 databases, and each database must have between 40 to 50 tables. For such a structure, rotate the…
-
1
votes1
answer149
viewsQ: How to configure mysqli TIMEOUT in PHP?
I have some servers I have to test if I have a connection. Some of these servers have blocked access to my machine for testing, so they’ll give the message Can't connect to MySQL server on. However,…
-
0
votes1
answer106
viewsQ: How to return a Mysql query with specific characters within each cell?
If in my column there is a field in this format: 181202272, (a varchar of 10 characters), I would like to return in my query through a SELECT by Mysql in this way: 18:12:02.272 //Nos dois primeiros…
-
2
votes2
answers147
viewsQ: Compressing files with PHP 5.1.6
I need to Compress files using PHP but my version is 5.1.6, I only tried to create the folder .zip using the code below, however, as stated in the manual this functionality is only available from…
-
2
votes2
answers2695
viewsQ: How to select a Python file using Tkinter
I have the following Python code using the library tkinter: from tkinter import * class Application: def __init__(self, master=None): self.widget1 = Frame(master) self.widget1.pack() self.msg =…
-
0
votes2
answers50
viewsA: how to deny direct access to index.php and index.php/
You can put at the end of your index.php and index.php/ the following: <?php header('location:home.php'); ?> With this every time someone enters this page, will be processed everything I had…
-
0
votes1
answer238
viewsQ: PHP cannot process heavy files
I have a PHP system that reads a TXT file, and performs an REPLACE in the database for each line, it does this well with small files (About 100 lines), but when I do with giant files (Over 1 Million…
-
2
votes1
answer1019
viewsQ: -1 Month does not return to the previous month - PHP
Wore the strtotime() to return to the previous month and always take the last day of the previous month, did so: $data_teste = date('Y-m-t', strtotime('-1 month')); And it was working so far…
-
1
votes1
answer118
viewsQ: Select for a specific period in Mysql
I know that if I want to query the date 5 days ago, I use the following Query: SELECT * FROM Tabela WHERE Data = DATE_SUB(CONCAT(CURDATE(), ' 00:00:00'), INTERVAL 5 DAY); Or you want to go back two…
-
2
votes1
answer43
viewsQ: Div’s overlapping in cell phone
I have a menu made with CSS that has a certain header spacing as can be seen below: However, when I open the phone, the same align in a way that end up being on top of the header: And without…
-
0
votes1
answer97
viewsQ: How to remove, insert, or change a single character in a field in Mysql?
I have the following table in Mysql: Id | comida | preco 1 | batata | 325 2 | carne | 3.10 3 | speculoos | 3.00 I wish I could change the points according to the needs below: If the food = potato,…
-
0
votes3
answers285
viewsA: PHP + SQL Add two values from the same column
The logic is kind of simple, but it works, if you adapt, you can make a generator of querys and insert new Ids whenever necessary: $execute = mysqli_query($conexao, "SELECT * FROM tabela_assim WHERE…
-
-1
votes1
answer389
viewsQ: How to make an INNER JOIN in a single table with 3 keys?
I have a table that has the following structure: origem|papel|campo018|campo040|mercado|Master_key| The column Master_key can have two values: 'NY' OR 'MS', I would like to compare the lines where…
-
0
votes4
answers4522
viewsA: Count number of records in a Mysql table with PHP?
PHP has a function just to count lines without using Count(*) which is the mysqli_num_rows(). With this you can reuse the result of the query. $QUERY = "SELECT * AS Quantidade FROM BancoA.tabelaA";…
-
1
votes2
answers460
viewsQ: Checking whether inputs are empty with Javascript
I have the code below that creates three fields in HTML these fields go through the checks below with Javascript, however, the part that should check if the person typed something does not work, I…
-
1
votes2
answers195
viewsA: Compare current time to time recorded in the database?
In place of $inip and $fimp you must put the time that is in your database: $QUERY = SELECT * FROM BANCO.TABELA; $EXECUTE_QUERY = mysqli_query($conexao, $QUERY); $DATA =…
phpanswered Geraldão de Rívia 940 -
1
votes2
answers42
viewsA: how to show the result of an sql in different <Section> files?
Do so: $dpto=null; foreach ($rows as $reg){ $departamento=$reg["nome"]; $titulo=$reg["titulo"]; if($departamento!==$dpto){ echo "<section>"; echo "<h1>". $departamento . "</h1>";…
-
-3
votes2
answers195
viewsQ: Input is "Cutting" what comes after space with PHP
I have a registration change screen. The information that will be changed I bring to an input field, allowing the user to move if necessary. however, a problem occurs if the word is separated by…
-
2
votes1
answer507
viewsQ: How to 'flip" chart of Google Charts?
I have the following chart that Gero using Google Charts: google.charts.load('current', {packages: ['corechart', 'bar']}); google.charts.setOnLoadCallback(drawStacked); function drawStacked() { var…
-
0
votes2
answers45
viewsA: While is not loading the logs
Instead of numbers, type the column name within the array index: while($registro = mysqli_fetch_array($consulta)){ $grp = $registro['ColunaA']; $tp = $registro['ColunaB']; $descr =…
-
3
votes2
answers471
viewsQ: How to line break a PHP string within a div
I own a <div> that creates a box where I should print a PHP string coming from a database, but when the string is too large, instead of performing the line break the string was "leaked" out of…
-
1
votes1
answer66
viewsA: Chart display on page
Where you name the columns, I think it looks better with the name of the products var data = google.visualization.arrayToDataTable([ ['DescricaoProd','Janeiro', 'Fevereiro','Marco', 'Abril','Maio',…
-
0
votes1
answer37
viewsA: Mysql search with only one of the selected fields
$result_empresas = "SELECT * FROM clientes WHERE (categoria_id = '$id_categoria' OR '$id_categoria' = NULL) AND (subcategoria_id = '$id_sub_categoria' OR '$id_sub_categoria' = NULL) LIMIT $inicio,…
-
1
votes2
answers820
viewsQ: Delimit table inside a modal with css
I have a modal that shows a table with some additional information from another table (I’ll call table), the problem is that the P table has many items, which makes it relatively large, and the…
-
2
votes3
answers325
viewsA: Why is this php calculator not working?
I did in a different way from the above companions just by consciousness disembowelment, and show other possibilities too. Instead of defining a value right in the <option>, define that the…
-
1
votes2
answers139
viewsQ: Crontab function does not work
I have a php script that performs (should at least) some recordings in a txt: 25 11 * * 1-5 wget -q --spider http://10.24.0.42/felipe_projetos/DD/CREATE_TABLE.NULL.IN.php However, the recording does…
-
1
votes2
answers775
viewsQ: How to sort an Array alphabetically in PHP?
I have an nxm array which I call $tabela. This array has some inside data organized as follows: | Papel1 | Hora1 | Valor1 | Erro | B | | Papel2 | Hora2 | Valor2 | OK_Ok | A | | Papel3 | Hora3 |…
-
0
votes3
answers803
viewsA: Populate array dynamically
When I fill array dynamically I do in matrix form, which transfer the table from the database directly to the array: $new_table = array(); for($a = 0; $a < 2; $a++){ //Avança as linhas…
phpanswered Geraldão de Rívia 940 -
1
votes1
answer48
viewsQ: How to use NOT IN with data from another server in PHP
I set up a table with Data that nay should be sought, I’ll call you here Table. The data that was in this table are these: |Tabela_Not| Londres Tóquio Paris And I applied this Query to make the…
-
2
votes1
answer684
viewsQ: What is the best way to record a user log?
I have a small monitoring system that aims to show if the data of some servers are equal to backups. As the system interacts directly with the database, the need arose to know who accessed and when…
-
0
votes1
answer289
viewsQ: Set variable to null in a Query in php
I have the following QUERY on my system: $Query = "SELECT * FROM Monit WHERE ($Modulo IS NULL OR Modulo = '$Modulo') AND ($Usuario IS NULL OR Usuario = '$Usuario') AND ($Data IS NULL OR Data_reg =…
-
0
votes1
answer156
viewsQ: HTML table with misaligned columns
I have this table: As it is possible to repair, the columns are not aligned with the lines, and I do not know pq and do not know how to tidy, since q smp did this way and never had this problem.…
-
1
votes1
answer837
viewsQ: return array(array) of a php function
I am storing the data of a database in an array in a file called php functions.: while($line = mysqli_fetch_array($execute)){ $tabela[$a][$b] = $line['Activit']; $tabela[$a][$b+1] =…
-
1
votes2
answers244
viewsQ: Align items on html page
I have the following code: CSS: .apoio{ float:left; } .box{ width:300px; height:100px; background-color:#666; border-radius: 10px; margin: 0 auto; } HTML: <canvas class="apoio" id="cvs"…
-
1
votes1
answer562
viewsQ: Sum Count() in mysql
I have this query that returns me the amount of equal dates: SELECT `Data`, COUNT(`Data`) AS 'Quantidade' FROM sua_tabela GROUP BY `Data`; | Data | | 2016-06-09 | | 2016-06-09 | | 2016-06-09 | |…
-
0
votes1
answer21
viewsQ: Return date quantity in Mysql
I have the table containing the date field. | Data| | 2016-06-09 | | 2016-06-09 | | 2016-06-09 | | 2016-06-08 | | 2016-06-08 | | 2016-06-05 | | 2016-06-01 | I want you to come back more or less like…
mysqlasked Geraldão de Rívia 940 -
1
votes3
answers3212
viewsQ: Force the User to enter a minimum number of characters
I have in my form the date field that forces the user to only numbers and if other options are not selected he returns an Alert. But my doubt relates to the field date already quoted. As I force the…
-
0
votes1
answer35
viewsQ: limiting a date field to only numbers
Currently my fields are this way: function formatar(mascara, documento) { var i = documento.value.length; var saida = mascara.substring(0, 1); var texto = mascara.substring(i) if (texto.substring(0,…
-
1
votes2
answers183
viewsQ: I cannot create a Modal with html
I’m trying to open a simple modal using HTML: .modal:target { opacity: 1; pointer-events: auto; } .modal > div { width: 400px; position: relative; margin: 10% auto; padding: 15px 20px;…
-
4
votes3
answers2732
viewsQ: Return hours and minutes apart with PHP
I have this simple file: php test. <?php $date1='2018-01-09 16:14:01'; $date2='2018-01-09 17:30:04'; $dateS1 = new \DateTime($date1); $dateS2 = new \DateTime($date2); $dateDiff =…
-
1
votes1
answer131
viewsA: How do I create a somaCum() function for Adian? C
Only this here solves your problem friend? void somaCum(float acc[]){ for(int n=0;n<accSize;n++){ float soma = acc[n] + acc[n-1]; Serial.print(soma); } }
-
2
votes2
answers430
viewsQ: Hover - css does not work
I’m doing something stupid but I don’t know which. Basically I’m trying to create some css classes, but it’s not working as expected td.ok { height:26px; padding-left:4px; padding-right:2px;…
-
2
votes2
answers287
viewsQ: Show confirm only after page loading
I am calling the following function inside the page: window.onload = function() { acess(); } function acess() { decision = confirm("Deseja realmente excluir o servidor cadastrado abaixo?"); if…
-
0
votes2
answers67
viewsQ: Condition to appear link does not work
I have the following logic that depending on what the user type, will return a link, however it does not work. <nav id="menu"> <ul> <li><a href="index.php">Minimo…
-
0
votes2
answers1269
viewsQ: Pass the GET variable over more than one page
Step two variables via GET to a page with a PHP condition, where I extract a new variable that I must send to a second page, but for this second page should go the 3 variables but is sending only…
-
3
votes1
answer1275
viewsQ: Print table with ajax and php
I’m trying to print a table using php, ajax and mysql. I have this excerpt in Html <!DOCTYPE html> <html> <head> <title>Teste Ajax</title> <?php…
-
0
votes1
answer427
viewsQ: Create Dropdown list from another Dropdown with PHP
I’ve been trying to do this for a while, but I failed miserably, I’m trying a different method than the ones I saw on the forum so I don’t think I fall for duplicity. I need to create a second…