Questions tagged as 'mysql'

2
answers

mysqli error: "expects exactly 2 parameters, 1 given"

You're giving this error:    Warning: mysqli_select_db () expects exactly 2 parameters, 1 given in My code is this: define("HOST", "localhost"); define("USER", "meu-usuario"); define("PASS", "minha-senha"); define("BDNAME", "meu_banco_d...
asked by 16.02.2016 / 01:19
2
answers

Make the primary key duplicable

When I insert the data into my SQL table everything is normal. However, when trying to insert a second time, with the same value in id that is the main field of the table, it returns the following error: Duplcate entry '156' for ke...
asked by 09.04.2015 / 22:39
2
answers

How to insert selecting from two different tables?

TABELA 1 - ID - IMOVEL - CODIGO - IMAGEM_G <----- nessa tabela este dado é vazio. - IMAGEM_P TABELA 2 - ID - IMOVEL <----- nessa tabela este dado é vazio. - CODIGO <----- nessa tabela este dado é vazio. - IMAGEM_G - IMAGEM_P I...
asked by 19.01.2015 / 19:09
1
answer

IFNULL is not working

select IFNULL(valor_unit,0) from tb_itens where id = 3 In the scenario where id = 3 does not exist in my table SELECT does not return '0' just keeps returning NULL, I can not find the problem. I have already tested with...
asked by 01.09.2018 / 18:14
3
answers

Field with Cedilla in Mysql

I have a field in my database table MySql with the name 'description', with special accents. My problem is: When I make a INSERT INTO directly using phpMyAdmin , it normally inserts the information into the table, but when using my...
asked by 11.05.2017 / 19:16
2
answers

Compare results

Dear colleagues. I am bringing two questions from the Mysql database as follows: .... Qual sua idade? <input type="text" name="Perguntas[]" value="<?php echo $jmPerguntas->Perguntas; ?>"> Você tem o segundo grau? <input ty...
asked by 15.07.2015 / 22:44
2
answers

How to select in a table as if it were two registers

In the person table you have the following information ID | NOME | É_ALUNO | É_RESPONSAVEL 1 | ALUNO | TRUE | FALSE 2 | RESPON| FALSE | TRUE There is another table with the name responsavel_aluno , this table has t...
asked by 26.04.2018 / 03:28
6
answers

How to count page views on a site

I'd like to implement a pageview counter on my site, display a numeric reference on the site, and use that data to perform a top-ranked article / post ranking and automatically insert a widget in the sidebar of the site. Node.js solves the pr...
asked by 10.03.2014 / 21:17
3
answers

Problems with WHERE IN (many records)

I need to mount a query to fetch records in table A, with records filter from table B. Something like: SELECT * FROM tabelaA tblA WHERE tblA.coluna IN (1,2,3,...) The values contained in the "IN" filter come from table B and in some cases...
asked by 10.03.2015 / 13:32
2
answers

PreparedStatement is not working

Code I'm using PreparedStatement i = conexao.prepareStatement("INSERT INTO teste VALUES (player='teste', level_1=0, level_2=0, level_3=0, level_4=0, level_5=0, level_6=0, level_7=0, level_8=0, level_9=0, level_10=0)"); i.executeUpdate(); Ta...
asked by 13.06.2015 / 19:17