Questions tagged as 'mysql'

0
answers

Servlet to add Contacts in mySQL does not work

I have an html sending request to a servlet which responds with error however when I run a testaAdicionaContato class. mySQL 5 table: create table contatos ( id BIGINT NOT NULL AUTO_INCREMENT, nome VARCHAR(255), email V...
asked by 01.03.2016 / 23:16
1
answer

Convert JSON to 2 string in php

Good. I have a json file that I wanted to convert to 2 string in php and then write to the database; my json currently comes like this: [ [ 1455628560, 2340 ], [ 1455628620, 2340 ], ] My problem is to select the...
asked by 17.02.2016 / 11:38
4
answers

Permission error when trying to access database [closed]

   Error: SQLSTATE [28000] [1045] Access denied for user 'root' @ 'localhost'   (using password: YES)     
asked by 06.02.2014 / 21:19
0
answers

How to create database via sql and utf8_bin?

I have the following sql script: CREATE TABLE IF NOT EXISTS 'pais' ( 'id' int(11) NOT NULL AUTO_INCREMENT, 'nome' varchar(60) DEFAULT NULL, 'sigla' varchar(10) DEFAULT NULL, PRIMARY KEY ('id') ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREME...
asked by 13.01.2016 / 19:25
2
answers

Pick up records that are 3 days old to win

I have a table named cotas that has a column ultimo_recebimento , in that column is the date in the form of time of the day that will be the last receipt of the user. I need to get all the records that are 3 days away. For ex...
asked by 29.12.2015 / 05:38
0
answers

Traverse all strings by delimiter in the field and generate a column with the result

SET @contador := 0; SELECT SUBSTRING_INDEX( SUBSTRING_INDEX("BOX 01;BOX 02;BOX 03;BOX 04;BOX 05;BOX 06;BOX 07;BOX 08;BOX 09;BOX 10;BOX 11;BOX 12;BOX 13;BOX 14;BOX 15;BOX 16;BOX 17;BOX 18;BOX 19;BOX 20;BOX 21;BOX 22;BOX 23;BOX 24;BOX 25;B...
asked by 25.02.2016 / 17:09
1
answer

List two mysql tables pdo

$catalog = $dbh->prepare("SELECT * FROM catalogo WHERE ativo = 2 ORDER BY catalogo_view DESC LIMIT 0,5"); $catalog->execute(); I want to search between two tables, how do I?     
asked by 26.02.2016 / 19:09
3
answers

Error inserting data into MySQL - CodeIgniter

I have the code <?php $chave = $retorno->resposta->cobrancasGeradas->cliente->cobranca->chave; $this->db->insert('boletos', array('id_fatura'=>$id_fatura, 'chave_boleto'=>$chave)); ?> When it executes this...
asked by 05.01.2016 / 00:14
1
answer

How to do an INSERT within the while

Hello, How do I do an INSERT within a loopback where comment id = comment id looks at the code $selecionarComentarios = $conexao->prepare("SELECT a.id_mark, a.id_user, a.comment, a.rate, a.id, a.active, b.name, b.avatar FROM tb_com...
asked by 13.01.2016 / 06:02
0
answers

How to insert default values in the table along with a variable value?

Scenery: I have a database with 2 tables, table A has the screens of an app, and screen B registers the activity on each screen, thus: ____________________ | Tabela A | ------------------- | id | tela | | 0 | p...
asked by 05.02.2016 / 03:29