Questions tagged as 'mysql'

4
answers

Numeric sequence loop in PHP

Good morning I have the result in MYSQL 01 03 04 06 11 I need a solution that fills in 2 zeros where it loses the numerical sequence up to number 12. Example: 01 00 03 04 00 06 00 00 00 00 11 00     
asked by 03.04.2018 / 14:41
3
answers

How to mount this SQL to bring months that are not in the list?

The SQL below brings the number of entries made month by month, until then blz. I needed to show the last 6 months, even if it was zero, but in this select it would only bring up when there are records. select extract(month from data_cad) a...
asked by 21.05.2018 / 17:44
3
answers

How to join 2 tables in a select?

I have the following tables in my MySQL DB: produtos_pedido with the following fields    id, order_id, product_id, qtd produtos_troca with the following fields    id, order_id, product_id, qtd I need to make a S...
asked by 16.08.2016 / 12:58
4
answers

Concatenating variables from an array

I need to Concatenate variables of an array, to execute a SQL, this array can have differentiated values. If the array is greater than 1 then it must have $ variable + $ variavel02. If the array is equal to 1. Then just play the variable. $arr...
asked by 10.08.2017 / 15:44
4
answers

How do I insert a value into every record in a column of a table?

I have the 'category' table and an 'id' column, with more than 100 records in that column. How do I add a value to all of these records? In case the value would be '3'.     
asked by 24.07.2017 / 18:48
2
answers

mysql deprecated [duplicate]

I'm trying to insert a row in mysql but it's returning this: Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO     
asked by 21.07.2015 / 02:27
3
answers

Convert date format DD / MM / YYYY to YYYY-MM-DD stored in a varchar

The data field is of type varchar , in June the date format is DD/MM/YYYY , but wanted to change it to YYYY-MM-DD since it is the format that MySQL accepts and to follow the current standard of July. After I swi...
asked by 27.07.2015 / 16:58
3
answers

Count of filtered dates per day in MySQL

I am a beginner in MySQL and have registered a table in PhpMyAdmin , where id is int , and all other fields are text , including data_cadastro field. I was in doubt, because there were several types of fields with...
asked by 16.11.2015 / 18:53
3
answers

With LEFT JOIN list the NOT IN

In Mysql I have the table usuario , with the fields ID and CPF : IreceivedalistofsomeCPFsfromtheclientandwhatIneed:SeewhichoftheseusersisNOTintheusuario_gerenciamentotable,theproblemisthattheusuario_gerenciamentotabledoesn...
asked by 06.12.2018 / 13:48
2
answers

Get values from one table that are not contained in another

I would like to know how I can get values from a mysql database where the data obtained must be in one table and not in another. For example: I want all equipment (table equipment) that is not reserved (table reservations)     
asked by 08.04.2015 / 22:10