Questions tagged as 'mysql'

2
answers

Input fields are not being filled according to the value

On my system there is a page with a form that registers an order and another page with a table that shows all the records of registered orders. In each row of the table has a request and an edit button that opens a form equal to that used in...
asked by 24.01.2018 / 17:37
1
answer

Error saving bank records

I have a normal form with a normal page to import the information into a normal bank table, but for some reason it goes straight to the die and does not save the information. Form: <form method="POST" action="update-cli.php"> <div...
asked by 24.01.2018 / 00:08
1
answer

SQL to find number within a range of two fields of Mysql table

My Mysql table has the following fields: id; num_min; num_max; The user will enter a number and need to verify that this number is in the interval between the num_min and num_max column of the table. I tried with between but it did not w...
asked by 06.03.2018 / 19:15
2
answers

Error in database workbench, birth date, error 0000-00-00

create table pessoas( id int not null auto_increment, nome varchar(50) not null, nascimento date, sexo enum('M','F'), peso decimal(5,2), altura decimal(2,2), nacionalidade varchar(20) default 'Brasil', primar...
asked by 20.02.2018 / 23:58
1
answer

Delete SQL record with dependency

Good afternoon. I would like to know how to exclude records from a table containing a foreign key. I would not like to delete child records (to keep history). I always get a message warning that there are dependencies when trying to upd...
asked by 31.01.2018 / 17:28
1
answer

Relationship between 4 tables

I have the tables: -- NORTE -- create table tb_indices_norte( id_norte int not null auto_increment, localidade varchar(30), sem_epi int not null, totOvos smallint, num_pos smallint, num_inst smallint, ipo decimal(5,1), ido decimal(5,1), ano v...
asked by 05.02.2018 / 22:45
1
answer

Update table so that a field has a unique value

How can I update a record in MySQL so that when I change a field in that record all other records change so that this field has a unique value? for example, I have a table called players and a field called artifact , which basically will rece...
asked by 07.02.2018 / 15:32
1
answer

how to do a query by ordering a rising column and a descending column

I need to do a query that looks for a growing column and in the same query another column in descending for example in the result below: item | quantidade carro | 400 carro | 340 dado | 240 disco | 180 disco | 120 faca...
asked by 25.04.2018 / 12:40
1
answer

SQL query with OR gets slow

I have a query that does the search using: WHERE pt.product_name LIKE '%termo da busca%' Then I want the search to also look for the artist name and put: WHERE pt.product_name LIKE '%termo da busca%' OR ct.mf_name LIKE '%termo da busca%'...
asked by 24.04.2018 / 17:22
1
answer

multiple insert to php database

I am creating a link shortener and wanted to put a multiple insert of type link the person places multiple links in an input separating each link with% or another character and each did qo php read% it from a new insert already tried several thi...
asked by 25.04.2018 / 16:48