Questions tagged as 'mysql'

1
answer

Make a select in a varchar column as if it were SQL datetime

The code is as follows: SELECT data FROM lista WHERE data BETWEEN '01-08-2015' AND '05-08-2015'; The problem is that the date column is a varchar and I would like to use it as a date     
asked by 05.08.2015 / 20:58
1
answer

Data cut in mysql

I'm adding a small text to my database but the text is always cut, for example:    Company X acts in private security with the purpose of preventing and reducing property losses in a particular organization, as well as inhibiting any action a...
asked by 12.08.2015 / 15:09
2
answers

Enter time function value in mysql

I think my problem is simple, I'm trying to insert into the database through the time() function but it does not enter values. Code $time = time(); mysql_query("INSERT INTO posts (user_id, estabelecimento_id, opiniao, data)...
asked by 01.03.2015 / 22:36
1
answer

Save input field to the database

How to store the last 100 searches made to a site (PHP / MYSQL) divided by country (eg store the last 100 searches for Macedonian books). Search is a simple simple field: <input type="text" id="search" name="search" placeholder="Search" /&g...
asked by 29.04.2015 / 14:30
1
answer

Insert excel column into a table in MySQL

I have a mysql table (it has 600 records): The edr_id column is a column that will be extracted from an excel cell, while in the tool I'm using ( MySQL for Excel ), just add and when I add the cell it's like I add more records. Is there an...
asked by 11.02.2015 / 14:02
1
answer

Replace String in MySql

I'm doing a query on a table. The filiais field returns the following value ["005","001"] I wanted the query directly to transform this string (varchar) into: ['005','001'] With the single quotes My query SELECT * FROM ba...
asked by 25.02.2015 / 17:07
1
answer

Update with JOIN in MySQL

I'm making an update to table A which will receive values from Table B as a.codigo = B.folha When running the routine below, it is slow and nothing happens for a long time. There are 500,000 lines. It's normal or I have to wait or the...
asked by 02.02.2015 / 06:02
2
answers

How to make a query with data from two related tables?

I have this case down: (Tabelas) cidades: id, nome_cidade,local +--------+----------------+---------------+ | id | nome_cidade | Local | +--------+----------------+---------------+ | 1 | Rio de Janeiro | Centro...
asked by 31.01.2015 / 01:57
1
answer

How to get an auto increment id and join it to a variable in the same insert

How to get a newly created auto increment ID and repeat it in another column by joining it to a variable? Ex: Na hora do Insert pego idxxxx repito somando a $varxxxx date_default_timezone_set('UTC'); while (strtotime($start) <= strt...
asked by 14.05.2015 / 21:41
1
answer

Problem with database insertion

I have the following code on my system: public int insert_dependente(Dependente dependente) { ResultSet r; int result = 0; if (!(dependente == null)) { try { Connection conn = new Conexao().getConnection();...
asked by 18.05.2015 / 00:17