Questions tagged as 'mysql'

1
answer

Do Select with value lookup in another table

I have a table with foreign key fields, and would like to return a select value of the item to the key. For example, I have the following table formed with the query: SELECT cod_produto, MQ1FK, MQ2FK, MQ3FK, MQ4FK, MQ5FK FROM engenha...
asked by 17.11.2014 / 18:47
1
answer

Secure backup using MySQL and C #

My application is C # and BD is MySQL, when I do the backup it creates a arquivo.sql . This arquivo.sql can be edited easily in a notepad, or any other editor, thus leaving my bd well summery, how can I do that nobody edits my BD...
asked by 30.01.2015 / 21:15
1
answer

Showing certain data depending on who logged in

I have a question regarding login for several people. I have this code: <?php include("conectar.php"); $usuario = $_POST['usuario']; $senha = $_POST['senha']; $query = " SELECT count(*) FROM usuarios...
asked by 05.02.2015 / 16:09
2
answers

How to normalize this database?

I have a problem creating a database where a company can have up to 16 employees. Where each worker can have this data: $sqlupdate3 = "Update tb_detalhe_trabalhador SET Nome3='$Nome3',Funcao3='$Funcao3', MedicaValidade3='$MedicaValidade3', Med...
asked by 26.06.2014 / 18:53
2
answers

Creating Logs page [closed]

I created a usr_logs table in my database with the following columns: id email ip time date sucess Only those records are sufficient, or do I need to add something else? How do I display all the data entered in this ta...
asked by 02.07.2014 / 05:02
1
answer

Error in SQL query

Hello, I have a table in the database that has several times stored in it. And I'm just making an appointment that is giving error. Inquiry: select proximo from (select localizacao.horario as proximo from localizacao where localizacao.horar...
asked by 01.10.2018 / 13:12
1
answer

calculating date in mysql update

Well I need to update my accounts that are over 5 months old, I wanted to do this right in mysql. The update looks like this: UPDATE contas SET baixa_valivade = true WHERE data_vencimento (Preciso verificar se já esta vencida a mais de 5 meses...
asked by 26.09.2018 / 18:16
2
answers

Format time result

I have the following fields: IwouldliketoformattheresultofmyfollowingQuery:SELECTTIMEDIFF(primeiraSaida,primeiraEntrada)+TIMEDIFF(segundaSaida,segundaEntrada)FROMpontoentradasaidaWHEREprimeiraEntradaBETWEEN'2018-09-13'AND'2018-09-14';Whereth...
asked by 13.09.2018 / 13:45
1
answer

JPA Error with MySQL 8

Hello, After updating my database, my application has been displaying exceptions of type java.sql.SQLSyntaxErrorException . The class below is the one it complains about, saying it does not exist when hibernate tries to create it. @Enti...
asked by 31.08.2018 / 15:52
1
answer

Copy records from one table to another via select

I am copying the records from one table to another on different banks, however a column in the new table can not be null and the data coming from the old table is null. Is there a way to put some conditional so that it "turns" null fields into s...
asked by 06.08.2018 / 20:29