Questions tagged as 'mysql'

3
answers

Complex SQL with MySQL

I have these tables and I need to make an sql command to receive this response. I use MySQL.    I've tried this and returns zero in all codes: SELECT COUNT( ei.sexo_id ) AS total_sexo_masculino, the.situacao_fin...
asked by 28.02.2018 / 12:56
4
answers

Which type is appropriate for field that saves hours in mysql?

I need to save a field that stores hours in the mysql database. It's a service register where I need to save the amount of hours for that particular service. When the service scheduling occurs at 11:00 am for example, the system adds hour...
asked by 12.10.2016 / 17:27
3
answers

Display comma-separated results with MySQL

administrador | regiao bruno | 2,3,4 pedro | 1 jose | 5,7 I have an admin table and a region table, where 1 administrator can manage one or multiple zones. I want to make a query that brings me the name of the regi...
asked by 03.09.2018 / 15:08
3
answers

Do not show element that has a certain value

In MySQL I have a table named user where all users of the site are stored: ID | NOME 1 | bla 2 | ble 3 | bli 4 | blo And a table called user_administration , where there are fields related to the management of these users: USUARIO_...
asked by 09.08.2018 / 20:09
2
answers

PDO error with variable in LIMIT

In PDO today was the first time I had to by a variable in LIMIT, and I'm getting this error:    Fatal error: Uncaught exception 'PDOException' with message   'SQLSTATE [HY093]: Invalid parameter number: number of bound variables   does not ma...
asked by 12.08.2016 / 18:17
3
answers

Many tables with few data or few tables with lots of data? [closed]

I have a bank that will receive a lot of data. I am in doubt whether it is better to organize the data into a few tables with too much data or to split the data further into multiple tables. In which case will the queries be faster? I'm using My...
asked by 10.10.2016 / 13:10
3
answers

Split the database to multiple clients or create one for each? [closed]

I'm developing an app for enterprise management. It will consume data from a MySQL database through a Web Server. My question is: What strategy do you follow to store each customer's data? Save all data from all clients in a single datab...
asked by 24.01.2017 / 13:36
5
answers

PHP that returns null table fields that are neither empty nor null in MySQL

I have a table "payment_forms" and I made an API to get all these forms of payment, but even the database is correct, it informs that the "name" field is null in return, see: [{"nome":"Dinheiro"},{"nome":"Cheque"},{"nome":null},{"nome":null}]...
asked by 09.02.2017 / 17:32
2
answers

Type in date search field in the format dd / mm / yyyy and search the database in the format YYYY-mm-dd

I want to type the date in the form dd / mm / yyyy format but then search the database in the format YYYY-mm-dd, Please have tried everything, from a HELP Ai     
asked by 26.07.2018 / 16:19
1
answer

Update with SET giving error

I have several UPDATE with pretty much the same code as this: UPDATE cliente SET Email = '[email protected]' WHERE idCliente = 0000; But some give this error:    Data truncation: Data too long for column 'Email' at...
asked by 10.08.2018 / 03:30