Questions tagged as 'mysql'

1
answer

Adding values from one column to two tables in MySQL

I'm a beginner in programming and would like to know how to add 1-column values into 2 tables, both with the same data. Just change the table name ... For example: Table teste1 : nome | pontos | Joao | 10 | Table teste2...
asked by 04.01.2019 / 02:23
1
answer

Storing images in MySQL and dealing with file size

I was able to store images in my bank, the problem now is just to try to make the images only enter the bank up to a certain size, assuming: 800kb. How to proceed? Follow the code: Botão Gravar: procedure TfrmFoto.SpeedButton1Click(Sender:...
asked by 11.07.2014 / 15:48
1
answer

Problem persisting: "Can not add or update a child row: a foreign key constraint fails ..."

Tables Contact CREATE TABLE IF NOT EXISTS 'sgct-database1'.'contato' ( 'contato_id' SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, 'telefone' CHAR(10) NOT NULL, 'celular' CHAR(11) NULL, PRIMARY KEY ('contato_id')) ENGINE = InnoDB AUTO...
asked by 14.07.2014 / 03:40
1
answer

change page 10 query in 10 seconds

I have a page that lists all my events from the event table ( tbl_eventos ). I want to list all the events of the first week of the year, past 10 seconds, list all events in the second week of the year, and so on. In my events table I h...
asked by 10.02.2015 / 11:51
1
answer

Codeigniter know if the insert worked?

Using codeigniter how can I know if the insert into actually worked? $novo_usuario=$this->db->query("INSERT INTO usuario (nome, email) VALUES ('pessoa','[email protected]')"); Through the variable $novo_usuario how can I be sure...
asked by 09.02.2015 / 20:15
1
answer

mysql data encryption

Can anyone help me, I'm using AES_ENCRYPT (string, string_key) ( manual ) for do cryptographic with key. Veja minha sintax. INSERT INTO trava (codigoliberacao) VALUES (AES_ENCRYPT('123456789', 'Chave')); ie. insert into table (field) va...
asked by 12.02.2015 / 13:59
2
answers

Calculate total days worked in a given month

I have a problem creating a system in PHP / MySQL. I have a form that I need to insert: Employee Name Date on duty Exit Date Usually something happens as in the example: the employee enters on 04/29/2014 and leaves on 03/05/2014. I ne...
asked by 14.05.2014 / 22:04
1
answer

Select random ID between 2 and 4

Is it possible to randomly select the ID, for example by entering ID numbers that can be drawn (2/4)? Note: Only one line of this selection should be returned. I put this code but it was not: SELECT descricao FROM TABLE ORDER BY RAND I...
asked by 18.10.2018 / 06:34
1
answer

I am not able to enter data in the bank

I am not able to enter data into the database, I was using PDO , but now I started to use MySql , because I was only able to list database data with MySql , I am able to list the data, but I am not able to insert. <?php $h...
asked by 17.10.2018 / 21:53
1
answer

What is the Parameter OPTION = 3 used for Database connections?

A connection to the database is usually something like this Driver=MySQL ODBC 5.1 Driver;Server=XXX;Database=XXX;UID=XXX;PWD=XXX;OPTION=3; Most google searches suggest this OPTION = 3. In the Mysql manual there is little and has a number...
asked by 16.08.2018 / 13:23