Questions tagged as 'mysql'

1
answer

Getting past mysql database record

I have two tables, I want to get the previous record of the recorded data from the second table based on the first one. Tabela 1 | Tabela 2 id - hora | id - id_tabela1 - cod 1 02:30 | 1 1 1 2 02:45...
asked by 28.09.2016 / 19:39
1
answer

How to create Array with DB content

I'm trying to create an array with the contents of a tabela of my banco but I do not know how, I tried to do this: // ATRIBUI UMA CONEXÃO PDO $pdo = Conexao::getInstance(); // ATRIBUI UMA INSTÂNCIA DA CLASSE CRUD $crud = Crud...
asked by 03.10.2016 / 23:54
0
answers

insert multiple data into mysql with while

Good evening guys! I created this code to insert 5 new users and passwords that follow a PAM1 ... PAM5 and CP@M20161 ... CP@M20165 CREATE PROCEDURE myfunction() BEGIN DECLARE i INT DEFAULT 1; WHILE i < 6 D...
asked by 04.10.2016 / 01:23
0
answers

Mysql query with dynamic columns

Friends have a question .... I have the following tables in Mysql: alunos (id, nome, etc) turmas (id, turma, etc) matricula (id, turmaID, alunoID) disciplinas (id, turmaID) avaliacoes (id, avaliacao) notas (id, matriculaID, disciplinaID, avali...
asked by 14.09.2016 / 01:11
0
answers

Search for a MySQL record without using? id = id in the URL

guys, I'm trying not to use the $ _GET [] link, but I can not figure out how to do that. That is, instead of "site.com/?post=nome news" stay "site.com/nome-noticia". I already ran forums and in the Stack also behind a solution, but I did not fin...
asked by 21.10.2016 / 23:49
2
answers

Load objects from other classes

I have selectOneMenu that will serve to list all Generations (data in the database). These data must be listed at the time of registering a Nature object. My selectOneMenu looks like this: <h:outputLabel value="#{msg['geracao'...
asked by 21.10.2016 / 22:24
0
answers

Consult MySql to bring events before, during and after the current date

I did this question but it was not very clear the code so I decided to post again with it complete. I ask the help of friends for a solution if possible of this code. I have a mysql database and am trying to make an event warning before, during...
asked by 08.09.2016 / 02:38
2
answers

How to know if a database has already been made in the database?

How do I check if a given id has been registered in the database, and if you have not registered use an insert query and if you are already registered use an update query?     
asked by 02.10.2016 / 17:53
3
answers

Consultation with connection in more than one bank php mysql

I have 3 databases and I'm looking for information in all three, but in my first query I've come across a one error: It is as if the query was searching in another bank that is not what I chose, here follows my query, the error message and m...
asked by 02.09.2016 / 17:36
2
answers

MySQL error "expects parameter 1 to be resource, boolean given in"

$query = "Select * from servico where ID_SERVICO = $id"; $result = mysql_query($query); if($row = mysql_fetch_array($result)) { $nome = $row['NOME']; if($nome == 'Marketing') { include ("servicos/marketing.php"); }...
asked by 07.08.2014 / 19:13