Questions tagged as 'mysql'

1
answer

Create procedure in phpmyadmin

I'm trying to create a procedure that changes between insert and update in phpmyadmin but it returns an error in the line of if EXISTS, then I tried to create it by the graphical panel and it returns error in the last line always ... Does anyone...
asked by 13.12.2017 / 15:23
2
answers

sql file or direct to the database

Today a question arose to me, I was creating a table in the database and I came across whether I should do this manually, directly in the database or create this table through queries, creating a .sql page. What would be best and safest?...
asked by 13.12.2017 / 01:22
1
answer

Query return generate Array

I have a query in MySQL. foreach($resultado as $row) { $lat = $row['lat']; $lon = $row['lon']; $horario = $row['horario']; } I need the result to mount an array similar to the one below. $markers = array( array("latitude" => $lat, "lon...
asked by 19.01.2018 / 15:04
1
answer

Display day selection with php and pdo

On this page I'm making birthdays of the month, and I was able to display all the birthdays that I have in the current month, but I'm not able to display the day, which I also selected in the database ... <?php...
asked by 19.01.2018 / 17:13
1
answer

Can a foreign key be part of more than one table?

IwouldliketoknowifIcanputaforeignkeyinmorethanonetable,forexample,wheretheentity"competitors" in the image is a table and the attribute "id_competidor" is a primary key, and the other entities "competitors_document "," competitors_endereco ","...
asked by 06.12.2017 / 20:22
1
answer

Update MYSQL table data

I can not perform UPDATE of the data in my table. $id = 7; $TrocaNome = "Ronaldo"; $TrocaEmail = "[email protected]"; $up = "UPDATE usuario SET nome='$TrocaNome', email='$TrocaEmail' WHERE id=$id"; var_dump($id,$TrocaNome,$TrocaEmai...
asked by 06.09.2018 / 15:52
2
answers

I need to select a recipe and its ingredients without repeating the other recipe fields

I have the following scenario: Recipe Table --------------------- id name preparation mode category Ingredient Table -------------------------- id name Ingredient_receive table -------------------------------------- id i...
asked by 24.11.2017 / 17:28
1
answer

Pick up sales media for a given month

I would like to take the average sales of the month by product description and not date by day, month and year, but I do not know how to get it. SELECT AVG(vend_qtde) AS qtde_vendas from tb_vendas WHERE esto_descricao like '% Saco pedra %' and...
asked by 04.01.2018 / 22:56
1
answer

Mysql Decoding - Javascript

Good afternoon, I have a procedure in MYSQL that returns processing information. ELSE IF(linhas_banco_in_p <> 0) THEN SET msg = 'ESSA CONTA E AGÊNCIA JÁ EXISTE NESSE BANCO, VERIFIQUE AS INFORMAÇÕES E TENTE NOVAMENTE';...
asked by 07.01.2018 / 20:01
1
answer

What is the error of this trigger?

I have this table: create table alecrim( id_alecrim int not null auto_increment, sem_epi int not null, p1 smallint, p2 smallint, p3 smallint, p4 smallint, p5 smallint, p6 smallint, p7 smallint, p8 smallint, p9 smallint, totOvos int, pend t...
asked by 09.01.2018 / 18:01