Questions tagged as 'mysql'

3
answers

Return to latest Date by column?

I have this table in 'MariaDB [accounts] > SELECT * FROM mercado WHERE nome_mercado LIKE 'extra'; +----+--------------+-------------+-----------+-----------+-------+ | id | nome_mercado | data_compra | produto | descricao | preco | +--...
asked by 28.07.2017 / 23:52
1
answer

How do I prevent a person from reserving the room on the same day?

I have the reservation code made, but the SELECT is so that people can not book the room on the same day I can not do. In my database I have the reservation table, in which the data is found.    backup_name, name, email, n_telef, checkin, che...
asked by 01.06.2015 / 21:19
2
answers

Generate csv file in php [closed]

Hello everyone, I'm trying to create a query in php in the mysql database to generate a csv file according to the code below. The problem is that the one that would download the file is presenting an error, I have reviewed it a few times and I d...
asked by 04.06.2016 / 22:12
2
answers

HTML and SQL connection [closed]

I'm designing a database with where I have a table with calculated indexes of data from other tables. I'm also designing an HTML dashboard to expose these indexes. My database is stored on a MySQL server. How do I extract this data and expose it...
asked by 31.07.2017 / 04:20
2
answers

How do I display a message if log found and if not found?

I have the following routine in php: or die ("Não foi possível realizar a consulta ao banco de dados"); while($rowfoto2 = mysql_fetch_array($ridfoto2)) { How do I display a message if log found and if not found? Thank you!     
asked by 22.12.2015 / 15:49
3
answers

Select the line with the largest ID [duplicate]

I have the val_products table, where product id and product_value , I need to give a select * only on the line whose ID is the largest, for example I have two products with ID's 1 and 2, but I need to return in that select only the line wit...
asked by 03.01.2018 / 20:02
3
answers

Is it possible to use if else in MySQL queries?

I've been researching the internet and hearing rumors that it's possible to use if else in MySQL queries but have not seen anything concrete about it. Is it really possible? If so, how? I want to make a query in three distinct tables i...
asked by 15.06.2016 / 00:38
3
answers

Select Sum in Table with PHP / Mysql

I have a table with the following fields: date, time and quantity . And I need to do a select sum addition. To understand better, I have a form where I insert a date, after I insert, I will make an appointment in the bank and in it I need to...
asked by 03.06.2017 / 17:30
4
answers

Make SELECT return data in the default language when it can not find a translation

I'm building a multi-language foundation. I have a select with the chosen language, but there is no guarantee that 100% of the content is translated, so I need to make a kind of or for the default language as a secondary alternative....
asked by 08.01.2015 / 20:29
3
answers

Handle single record while

Considering that I'm developing a small simple (photo) ranking, I need a solution to get the first 3 records from the select and apply individual formatting to them, the rest unnecessarily. Note: I do not wish to have to use 2 lops, one way mayb...
asked by 21.05.2014 / 19:34