Posts by Jasar Orion • 1,052 points
75 posts
-
0
votes2
answers1150
viewsA: Check if a file exists within a Python IF
uses this command is what I use in my cods: import os.path if os.path.isfile('arquivo.txt'): print("é arquivo")
-
0
votes2
answers90
viewsA: Error when registering form in database
your problem is precisely in connection $conexao = mysql_connect('localhost', 'root', '', 'formulario'); mysqli_set_charset($conexao, 'utf8'); Note that you initiate connection by mysql and uses…
-
0
votes1
answer63
viewsQ: SED on linux does not work
Good afternoon, I’m having trouble deleting a line in my crontab using sed. my line is this: 0 1 * * * root shutdown -r +1 my sed that doesn’t work: sed '/0 1 * * * root shutdown -r +1/g'…
sedasked Jasar Orion 1,052 -
0
votes3
answers721
viewsQ: Select Distinct is bringing duplicate Mysql data
I need to bring only the last record of each id_face that has in the table imagens, but for some reason it’s bringing id_faces duplicates. Follow my consultation: SELECT DISTINCT(i.id_face) as…
-
1
votes1
answer36
viewsA: Calculate ID from Database
You can do it in your php as follows: 1) do the Insert on your bank 2) Then take the last id inserted with the function below `$ultimoId= mysqli_insert_id($con)`; 3) then put the zeroes on the left…
phpanswered Jasar Orion 1,052 -
0
votes2
answers120
viewsA: Connection to a Database
your code is with error in variable $con note that in your connection file you use $conexao try this way : <?php include ('admin/include/conexao.php'); $result = mysqli_query($conexao,"SELECT *…
-
1
votes1
answer60
viewsA: Taking only the attribute "src"
if it’s php and your string is iframe does so $variavel='<iframe class="embed-responsive-item"…
phpanswered Jasar Orion 1,052 -
-3
votes2
answers233
viewsA: Error when associating connection variable (PHP/Mysqli)
I do different try this way: $db = "nomdedodb"; $servername = "localhost"; $username = "usuario"; $password = "senha"; $con = mysqli_connect($servername, $username, $password, $db); $sql="sua query…
-
1
votes1
answer186
viewsA: Mount a result array of a php foreach
does so on your Cod foreach($Result as $Aluno): extract($Aluno); echo '<tr>'; echo "<td class='nome'>{$Nome}</td>"; echo "<td class='centro'>{$finalNota}</td>"; echo…
-
0
votes2
answers1029
viewsA: Consult two tables without foreign key and relationship
you can use the first 2 fields as foreign: SELECT a.COD_EMPRESA, a.COD_FORNECEDOR, a.DATA_EMISSAO,a.VALOR_PEDIDO,b.DATA_ENTRADA,b.DATA_PAGAMENTO, b.VALOR_PAGAMENTO from TB_PEDIDO a, TB_PAGAMENTO b…
-
1
votes1
answer389
viewsA: Detect the mobile operating system and redirect to a specific page
use this function function descobreOs() { var userAgent = navigator.userAgent || navigator.vendor || window.opera; if (/windows phone/i.test(userAgent)) { return "Windows Phone"; } if…
-
0
votes0
answers51
viewsQ: Query in mysql grouped by hour
Good afternoon. I am performing a query in mysql and this returns the precise values. My problem is to display the values that do not return by e.g.: I asked to group by hour or day it only returns…
-
0
votes2
answers448
viewsA: How to return empty value?
use the COALESCE function would be so: COALESCE(TOTAL + ( SELECT (SUM(ISNULL(CSA.ContabSaldoMovCtaValDeb,0))) - (SUM(ISNULL(CSA.ContabSaldoMovCtaValCred,0))) FROM CONTAB_SALDO_MOV_CTA CSA WHERE…
sql-serveranswered Jasar Orion 1,052 -
-1
votes2
answers124
viewsA: Simulate Click with webview on a href
I do using the querySelectorAll the ex of selection would be something like this webEngine.executeScript( "document.querySelectorAll(\"#tb_next > .page-link\").click();" ); it would click on all…
javascriptanswered Jasar Orion 1,052 -
1
votes2
answers79
viewsA: Mysql query using JOIN
Try this query: SELECT p.nomeprofessor,a.nomealuno from professor p JOIN aluno_has_professor ap on p.idprofessor = ap.professor_idprofessor JOIN aluno a on a.idaluno = ap.aluno_idaluno WHERE…
-
0
votes3
answers73
viewsA: Remove specific line of files on linux
I managed to solve ^^ sed '/* * * * * root \/home\/linaro\/funcao4.sh/d' /etc/crontab > /home/linaro/mycron cat /home/linaro/mycron > /etc/crontab rm -rf mycron…
-
0
votes3
answers73
viewsQ: Remove specific line of files on linux
I need to remove a particular line in a file crontab ex: * * * * * root /home/linaro/funcao1.sh * * * * * root /home/linaro/funcao3.sh * * * * * root /home/linaro/funcao4.sh * * * * * root…
-
2
votes2
answers35
viewsA: Create a grouped query by month
there are two ways to do follow the ex: GROUP BY DATE_FORMAT(sjy_vendas.dt_nf,'%Y-%m') or else you make a month and year Xtract of the date field like this SELECT EXTRACT(YEAR_MONTH FROM…
-
0
votes2
answers263
viewsA: Clear input with Jquery with more than one class
makes it so much simpler: $(document).ready(function(e) { $('.meubotaolimpa').click(function(e) { $('input[type="text"],input[type="password"]').not('.noclear').each(function() { $(this).val('');…
-
0
votes3
answers71
viewsA: Add today’s date by estimated travel hours
the correct way to add hours to a date is this $startTime = date("Y-m-d H:i:s"); //exibir a hora de início echo 'Starting Time: '.$startTime; //adiciona 1 hora ao tempo $cenvertedTime = date('Y-m-d…
phpanswered Jasar Orion 1,052 -
0
votes2
answers1544
viewsA: Script . sh to run a python script from within Cron
I managed to solve the problem as it went my final Cod #!/bin/sh ps -aux | grep -P '[p]ython3 /home/linaro/aifaces/main.py(?! -post)' > /dev/null var1=$? ps -aux | grep '[p]ython3…
-
1
votes1
answer207
viewsA: jquery.iframetracker Does not work on Mozilla Firefox, can you fix it?
I made a modification in your code see if it works this way: <script src="https://code.jquery.com/jquery-1.11.3.min.js" type="application/javascript"></script> <script…
-
0
votes3
answers770
viewsA: Send data to Database according to <select> tag via PHP
if the name of your <select> for table do so: $sql="INSERT into `".$_POST[tabela]."` set campo1='".$_POST[var1]."'"; mysqli_query($con,$sql); Obs: this if you are using the mysqli if it is…
-
8
votes1
answer496
viewsA: How to Inspect an element that only appears when I do Hover on another element?
Follow the steps: Click on the element you need to give the hover and Inspecione element in it. In HTML check that this element is selected and you will see on the right an item :hov Click on :hov…
-
2
votes2
answers1544
viewsQ: Script . sh to run a python script from within Cron
Good morning. I’m having a problem with a python program I did. What happens is that when I run my program from the command line with this command it works normal : python3…