Questions tagged as 'mysql'

3
answers

Condition select

I need to create a SELECT that contains only records of an x value onwards. For example, returning only movies with number of copies greater than 5 My Select router.get('/filmes', (req, res) =>{ execSQLQuery('SELECT IF(copias >...
asked by 07.12.2017 / 13:41
2
answers

Use INSERT using SELECT (Node.js and MySql)

I need to insert some data into a table, using the following code: var query = 'INSERT INTO uso (id_usuario, id_tempo) VALUES ((SELECT id FROM usuario WHERE nome='Jose' LIMIT 1), (SELECT id FROM tempo WHERE timestamp=1505530800000 AND nome...
asked by 17.09.2017 / 01:36
1
answer

ERROR 1264: 1264: Out of range value for column 'cpf' at row 1 SQL Statement

I have a problem with MySQL, I created the following table: create table pessoas ( cpf int (11), nome varchar(30) not null, nascimento date, endereco varchar(30) not null, cep int(7), bairro varchar(20), cidade varchar(30), uf char (2), primar...
asked by 16.04.2018 / 22:07
1
answer

How to update specific employee in table in MySQL?

I have a database in SQL (banco_sql), where there is the employees table with 4 fields (ID, OFFICIAL, SALARY, DEPARTMENT). ID FUNCIONARIO SALARIO DEPARTAMENTO 1 Pedro 1400 TI 2 Isab...
asked by 17.05.2016 / 13:48
1
answer

Registration in php

Hello, all good? I have a problem in performing data insertion in a MYSQL database. When I type a password in my form, for example: metas123, or any other password, it stores the value 0, instead of the string typed, and I really have no idea wh...
asked by 04.05.2018 / 21:14
2
answers

How to search for the selected value in MySQL / PHP and HTML?

Good afternoon! How do you make a SELECT that returns the result only for the value filled in form HTML ? For example, if someone completes the TRAVEL field that returns all values that contain the completed trip. Or if someone c...
asked by 16.07.2018 / 19:01
2
answers

How to perform an "IF" by SQL

Hello, how can I do something similar to an if but per sql? For example: There is a field in the database named dt_ini with no value so far. I would like to do: "If dt_ini == '' insert into table ( dt_ini ) values ..." I would have to que...
asked by 04.10.2017 / 19:42
1
answer

Problems with SQL enconding x PHP [duplicate]

I have the following problem: My files are leaving with accentuation problems, my tables use utf-8 as encondig, the html files have the markup for utf-8 and even then the accents do not work: <html> <head> <base href="http...
asked by 05.06.2018 / 14:24
2
answers

How to mount a JSON structure?

I have the following JSON: { "status": true, "msg": "", "frete": [ { "Transportadora": "Correios", "Tempo": "16", "Msg": "", "Codigo": "04510", "Servico": "PAC", "Valor": "131.30" },...
asked by 30.05.2018 / 18:04
2
answers

PHP Search error [closed]

I search with existing numMec and it appears to me that it does not exist in the database <?php if(isset($_POST['search'])){ $searchq = $_POST['search']; $searchq = preg_replace("#[^0-9]#i","",$searchq); $query = mysql_query("SELECT * FROM...
asked by 20.12.2017 / 13:57