Questions tagged as 'mysql'

3
answers

Return checkbox checked PHP

I have this code: <?php $pdo = db_connect(); $sql = "SELECT * FROM cor_fundo"; $query = $pdo->prepare($sql); $query->execute(); $option = ""; $result = $query->fetchAll(PDO::FETCH_ASSOC); foreach ($r...
asked by 13.07.2017 / 21:11
2
answers

MySQL with NodeJS: insertion of records

I created a script called 'test.js' just to demonstrate a simple insertion of log records into a MySQL database, using NodeJS, as below. I will generate something around 5 logs per second, which makes me assume that it will require a certain pro...
asked by 17.07.2017 / 20:53
2
answers

Doubts with value of the selects

I made this form with the selects doing direct database search and also sorting the data, but at the time of sending the answered form the value that goes in <option> is not the value that I want and yes another value,...
asked by 17.07.2017 / 21:34
1
answer

Create new instance in MySQL

I'm trying to create a new MySQL instance on a machine that already has it installed. I made the manual process of creating a new directory and configuring the .ini file, however at the time of starting the service the following error is...
asked by 16.07.2017 / 19:58
1
answer

Error 1452 mysql: Can not add or update a child row

I created the following tables and populate them in 2 (user and type); CREATE: CREATE TABLE utilizador(utilizador_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,username VARCHAR(100) NOT NULL, password VARCHAR(100) NOT NULL, morada VARCHAR(100)...
asked by 17.07.2017 / 02:32
1
answer

Problems setting up MySQL on Windows

The MySQL Installer application is failing in the configuration part, exactly at the time it creates the service, does anyone know the reason for this problem? Note: I am connected to a local user and administrator. The result of the log is:...
asked by 16.06.2017 / 22:07
1
answer

Issue an ALERT for a UNIQUE field in Mysql

I have a field in the DB set to Unique, to avoid duplicate registration. It works perfectly. I would like to know if there is a way to customize this message with an Alert, for example. My code: <?php require 'conexao.php'; $nome...
asked by 12.06.2017 / 21:10
1
answer

Creating event in Mysql

I would like to create an event based on 2 situations. I have a table and column a situation_id with values    [1 - free], [2 - busy], [3 - Not available]; And another modified column - it generates the date of modification of the regi...
asked by 16.06.2017 / 15:35
1
answer

Array bringing different results in PHP

I have my bd, however, it's bringing me a different result than the one in the bank $consulta = "select * FROM PRODUTO_pedido WHERE PEDIDO_PED_ID =12"; $resultado = $db_con->query($consulta); $contador = $resultado -...
asked by 18.07.2017 / 21:06
2
answers

php array converted to json does not maintain order in mysql

I have an array of the following format: $vetor = array( 1=>array( pt-BR => array( 'pergunta1' => 'pergunta 1 em texto' 'resposta1' => 'resposta 1 em texto' ) ) 3=>array( pt-BR =&g...
asked by 03.07.2017 / 20:24