Questions tagged as 'mysql'

1
answer

My SQL Error 1215: Can not add foreign key constraint!

Well when I'm adding the references it gives this error, the error appears from the 3rd alter table that I do! create database tipoUber_bd; use tipoUber_bd; create table users( CPFUsuario char(11), NomeUsuario varchar(30),...
asked by 15.07.2018 / 07:47
1
answer

Pick 1 record per date without repeating the date

I have a box system where every time the box is opened and closed per day is registered in the table, the box is opened and closed several times a day, however I would like to only pick up the first opening of the day and with that list the last...
asked by 13.06.2018 / 16:25
2
answers

Error: Undefined index

I have this code and it gives me the following error:    Notice: Undefined index: ID in <? require('../members/inc/config.php'); require('../lib/framework.php'); // load the configuration file. $newsid = $_GET['ID']; $stmt = $db->q...
asked by 27.01.2015 / 23:26
1
answer

Integrity constraint violation: 1062 Duplicate entry [closed]

   SQLSTATE [23000]: Integrity constraint violation: 1062 Duplicate entry   '202-564' for key   'UNQ_CATALOG_PRODUCT_SUPER_ATTRIBUTE_PRODUCT_ID_ATTRIBUTE_ID', query   was: INSERT INTO catalog_product_super_attribute ( product_id ,  ...
asked by 07.03.2016 / 13:47
2
answers

Mysql error 1215: Can not add foreign key constraint [closed]

-- 1 -- create database clinica; use clinica; -- 2 -- create table ambulatorio( idnroa int(15) unsigned not null auto_increment, andar int(15) not null, capacidade smallint(45) not null, primary key (idnroa) ); create table medicos( idcodm int(...
asked by 01.03.2016 / 21:16
1
answer

How to retrieve elements from another table in an SQL query?

I took data from a wp_posts table and now I need to get data from the wp_postmeta table that matches < strong> ID tag captured in the wp_posts table. This data is the product_img1 , product_img2 , product_img3 > as shown in the...
asked by 31.10.2014 / 19:55
1
answer

Error of passage by reference, insert in the bank

I had the following errors:    Notice: Only variables should be passed by reference in   /var/www/html/crud/banco/Banco.php on line 30       Notice: Only variables should be passed by reference in   /var/www/html/crud/banco/Banco.php on line...
asked by 24.03.2018 / 02:22
1
answer

UPDATE in two tables [closed]

I would like to make a update using a Inner Join . I've tried this: UPDATE m SET m.rua = 'Rua Major Gote', b.desc_bairro = 'Centro', m.id_tipo = '', m.numero = '652', m.CEP = '38700001', m.cidade = 'Patos de Minas' FRO...
asked by 16.08.2017 / 16:24
1
answer

Advanced Search PHP

I have a table named vehicle_drive with the following fields: id_cadastro ,             id_user ,             status ,             estado_veiculo ,             tipo_cadastro ,             fabricante_veiculo...
asked by 13.07.2017 / 14:20
1
answer

How to sum all the values of a column in MySQL? [duplicate]

How do I add up all user points? For example: ID | NOME | PONTOS 1 | Joao | 100 2 | Bia | 50 It is known that the sum of all points in the database is 150.     
asked by 02.09.2018 / 22:48