Questions tagged as 'mysql'

2
answers

PHP how to leave select set

I have a select that takes the data from the database to do an insert: <div class="row"> <div class="form-group col-md-2"> <label for="marca">Marca</label> <?php...
asked by 27.01.2018 / 13:29
2
answers

Error in registering the query in bd

I made a registration page on my site, which to do the registration needs cpf and email. I made a SELECT to see if it already exists, if yes, not insert, otherwise it does not insert. I left the cpf as pk and email as unique. When I put an exist...
asked by 06.12.2017 / 14:12
1
answer

Insert with Foreign Key (user + address (FK)) PHP (PDO) + MySQL

Good afternoon, guys. I have a small question: When registering a client (with an address field (fk)) is the correct way something like this, or does it have a better way? INSERT INTO endereco(logradouro, numero, bairro, cidade) VALUES (:log...
asked by 30.11.2017 / 20:07
2
answers

How to open a new window through PHP with the results of a SELECT?

I have a form in which the user can select several materials, and then a subject is selected, through PHP I will pull the database by SELECT and I will show on the screen with echo results. My code: <form id = "questions_...
asked by 30.11.2017 / 23:19
1
answer

Time Manipulation [HH: MM: SS] - php and mysql

Good afternoon, guys. I need to manipulate time fields [HH: MM: SS] in PHP itself. I get the values in text in the HTML form as in the following example: <div class="item form-group"> <label class="...
asked by 01.03.2018 / 20:34
2
answers

Insert data into the database with php

I'm trying to insert some data into the bank via php, but it can not add that data, would anyone know what it might be? I give a var_dump in the array to know if it is pulling the data correctly and it is. I'm trying to pull data from one table...
asked by 06.11.2017 / 16:14
2
answers

Automatically update timestamp in update

Using UPDATE CURRENT_TIMESTAMP is it possible to automatically update a field from a table in the MySQL database? I want the inclusion date to be included in the fields: dt_cadastro and dt_atualizacao . And when a chang...
asked by 03.11.2017 / 12:17
1
answer

Join in sql that returns all

I have two tables, the one of episodes and of episodes seen, I need to make a query that will join the two by the id of the episode, but I do not want the episodes that are not in the second table do not come in the result, an example: Thisi...
asked by 24.10.2017 / 19:21
1
answer

Relationship between tables of same values in columns

I want to do a sql query that lists two columns of two different tables, which store the same types of values, but one has some that the other does not contain, eg: Table 1 has the column code and Table 2 has the column code I w...
asked by 20.11.2017 / 00:09
1
answer

How to make an INNER JOIN by bringing specific fields from two tables and removing the repeated records and with a max condition?

Well, I have the following tables: Table 01: Andtable02: Then I would like to bring only all the fields with bigger points and do not repeat the waiter in case, how to do it?     
asked by 19.11.2017 / 22:08