Questions tagged as 'mysql'

2
answers

Select and delete duplicate records by last update date?

Between the table fields there is the field name, the field dt_add which is the date the record was inserted and dt_update which is the date of the last update of the record. I would like to know how to return and delete repeated records, for...
asked by 07.11.2017 / 20:48
1
answer

How to update mysqli database table with UPDATE?

I am creating a data listing system, and I created a data change page, with 6 fields, name, experience, email, phone, city and bio. but my function does not update the fields. The data arrives in function change_data () but does not update in...
asked by 08.11.2017 / 13:28
4
answers

How to get the last login of each user using mysql?

I have the following table: CREATE TABLE 'adm_historico_acesso' ( 'id' int(10) UNSIGNED NOT NULL, 'data' timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 'ip' varchar(100) NOT NULL, 'usuario' varchar(100), 'codigo' varchar(100) CHARACTE...
asked by 03.10.2017 / 14:11
1
answer

Insert ID from one table into another

I have seen other posts but they do not supply my need, I am with the error that only searches for the first ID of the person table and not what is inside the field, example: I have the ID 6700 inside the input and it inserts in the pjuridic tab...
asked by 27.09.2017 / 15:08
1
answer

Insert JSON file into the database via PHP

I have a JSON file that I need to insert the information contained in it into the database. JSON file: {"retorno":{"produtos":[{"produto":{"codigo":"AAAAAA","estoqueAtual":20}},{"produto":{"codigo":"BBBBBB","estoqueAtual":10}}]}} How I'm...
asked by 26.10.2017 / 21:38
1
answer

Problem do not select

How to solve this? create table tbl_prescricao( id_prescricao int not null primary key auto_increment, tipo_prescricao varchar(250) not null, valor_prescricao decimal(10,2) ); create table tbl_juntaprescricao( id_junta int not null primary ke...
asked by 24.09.2017 / 23:06
1
answer

How to do inner join in associative table? [closed]

Tables and inserts: CREATE TABLE CLIENTE( IDCLIENTE INT PRIMARY KEY AUTO_INCREMENT, NOME VARCHAR(30) NOT NULL, SEXO ENUM('M','F') NOT NULL, ID_CARRO INT UNIQUE ); INSERT INTO CLIENTE VALUES (NULL,'GABRIEL','M',1); INSERT INTO CLIE...
asked by 19.09.2017 / 02:42
2
answers

break date into 3 columns in a mySQL query [duplicate]

I have a system where I need to select any date in a calendar, so accurate returns all the records of the month of that date, for example: I have 4 dates, 08/01/2017 , 06/08/2017 , 14/09/2017, 2017 . Suppose I clicked the date "08/01/2017" a...
asked by 07.10.2017 / 01:36
1
answer

Result after update

Hello, I would like a value of 1 after a run in the database, for example I have the function in php: function registrar_pagamento( $pago, $registro ){ require_once "../controller/class.registro_controller.php"; $reg['registro'] = $...
asked by 06.10.2017 / 16:24
1
answer

res.json NodeJS / Express

I have a cruel doubt on nodeJs / Express, I'm pretty new to the language but what I need is to pass the id on a route so that it executes and returns a query. I want to do in fragmented files, so I have a Routes file (with all routes) an API...
asked by 06.10.2017 / 22:27