Questions tagged as 'mysql'

3
answers

Select to bring the amount of certain records into related tables

In the MySQL database I have these 3 tables: CONTROLS: Here I make the trainings entries made. Note that you can insert multiple collaborators on the same line EMPLOYERS: SECTORS: ThecontributorscolumnoftheCONTROLtableisaforeignkeyintheCO...
asked by 17.09.2018 / 13:18
1
answer

Select a list of values and from this list, select the lowest value

I want to select the last 10 inserts of a table and among those 10, return the lowest value. Is it possible to do this in a single query? Selecting the last 10 values: SELECT id_relevo FROM relevo ORDER BY id_relevo DESC LIMIT 10     
asked by 23.09.2018 / 03:30
4
answers

SQL command too slow

SELECT funcionario.nome, foto.foto, count(*) total FROM venda, funcionario, foto WHERE venda.idfuncionario = funcionario.idfuncionario AND funcionario.idfuncionario = foto.idfuncionario AND gol = 1 AND ativo = 1 AND idsancall IN (5,7,8,42...
asked by 24.09.2018 / 19:54
3
answers

While inside another While (PHP - SQL)

I searched the forum and the internet, but I could not solve the problem yet! I am doing a query in the bank by PHP and looking for users. After searching the users I look for his academic formations within that other search (since there may be...
asked by 11.01.2016 / 13:02
2
answers

How do I get the autoincrement id without being registered?

Hello, How do I get the id that is autoincrement without the item being registered in the database? Or I will have to do 2 process, first register the post, then register the post in the category? I'm with a system to register posts here,...
asked by 09.02.2016 / 20:25
3
answers

Resolve undifined index [closed]

I'm trying to create a table with data from a database
asked by 18.01.2016 / 11:13
1
answer

JOIN 3 different tables display list

Good morning. I'm trying to joke 3 tables and display in a list, but I'm not getting it. I've drawn (with LESS LINES) the tables in the database and an idea of how I'm trying to list the fields. IthinkthatforthisIshoulddo3joins,butitisnotw...
asked by 02.05.2015 / 18:07
2
answers

Recover database records by date field?

How do I retrieve users saved in a database table by field dt_nascimento through two values that represent the minimum and maximum age of users that should be returned, the minimum and maximum age does not always come together can be specified o...
asked by 28.04.2015 / 16:55
1
answer

Print data from the MySQL table in PHP

I have the following code: <?php //iniciando a conexão com o banco de dados include_once("conectar.php"); if (!$strcon) { die('Não foi possível conectar ao Banco de Dados'); } $sql = mysqli_query("SELECT * FROM cadastro"); $exibe = mysql...
asked by 24.08.2018 / 15:48
2
answers

Select all people who have the anniversary date greater than 2000

I'm trying to select all the people who have the anniversary date beyond 2000 This date has to be accurately taking into account the day and the month, not simply decreasing the year!     
asked by 05.09.2018 / 12:56