Questions tagged as 'mysql'

1
answer

Display mysql query results in Master / Detail

I have the following result of a query: CATEGORIA | SUB cateroria1 - sub1 categoria1 - sub2 categoria1 - sub3 categoria2 - sub1 categoria2 - sub2 categoria3 - sub1 How do I echo the data like this: categoria1 sub1 sub2 sub3 categoria2 su...
asked by 06.02.2018 / 22:30
1
answer

Problem in displaying the result in php when there is only one record in the DB

The code below returns some value, when there are several records with the same name or similar, when there is only one record in bd does not return the value of that record. <?php include_once '../../Modulos/Database/Banco.php'; $pesquisa...
asked by 23.01.2018 / 23:40
2
answers

How to store a SELECT value in a variable in MYSQL?

It's quite simple but I can not find the information I want, people! I once saw how to do this but it was very shallow, but I'll explain what I want: I have a variable and I want it to receive the value of a certain column that will come w...
asked by 24.01.2018 / 18:10
1
answer

return array (array) of a function in php

I am storing the data of a database in an array in a file called funcoes.php : while($line = mysqli_fetch_array($execute)){ $tabela[$a][$b] = $line['Activit']; $tabela[$a][$b+1] = $line['Usuario']; $tabela[$a][$b+2...
asked by 19.02.2018 / 20:26
1
answer

Pick up a record as soon as it is saved in the bank

I'm writing a record to my database like this: $tipo = $_POST['tipo']; $data = $_POST['data']; include 'conexao.php'; $result = mysqli_query($con, "insert into sessoes (tipo, data) values...
asked by 19.02.2018 / 18:51
1
answer

Calculate difference between timestamp field with specific timestamp

I'm trying to develop a ranking table for a sort of questionnaire. Each day a question is asked at 4:00 p.m., which can be answered by 17:59:59 the next day. The table has to show the position of the participants taking into account the numbe...
asked by 08.02.2018 / 13:42
2
answers

Bring repeated records of 3 columns in the same table

I have a table with transport data from my company employees: nome ! valor1 ! valor2 ! valor3 teste1 ! 6.50 ! 0.00 ! 0.00 teste2 ! 4.30 ! 2.80 ! 1.10 teste3 ! 8.40 ! 1.10 ! 0.00 teste4 ! 2.85 ! 1.10 ! 0.00 Where it is possible for the empl...
asked by 16.01.2018 / 19:43
1
answer

Check changes to the database correctly

I need to check changes in my database and I created a script that sends requests every millisecond by calling a function that returns the number of rows in that database, but I realized that it is a very wrong way to do this because it leaves m...
asked by 09.01.2018 / 21:01
1
answer

How to generate query and add new input?

I have a field input of type date I want every time I click and view it, it generates a select with the query of the date that I set and generate a new input to add another date and so on. > My code so far: HTML FORM <for...
asked by 29.01.2018 / 21:28
1
answer

Deleting a record in MySQL DB

Good afternoon. I need help with deleting a BD MySql record. I have a DB that has a table called KEYS. Ihaveapagecalledlist.php,thispagereceivesthevaluesfromthetableKEYS.OnthispageyouhavealinkcalledDELETEwhichwhenclickingthislinkleadstoapage...
asked by 29.01.2018 / 20:15