Questions tagged as 'mysql'

0
answers

Triger after update as a solution to debit credit securely

I need to make an interface that guarantees the integrity of the customer's credit. In PHP, when we use LOCK explicitly in the PDO, with LOCK TABLES, if there is an inconsistency, when the same client object is in several processes relating even...
asked by 21.02.2017 / 20:18
0
answers

Insert sql with rule WHERE NOT EXISTS does not work

This insert below only works until the first "Where" rule then does not work anymore Example WHERE descricao ='$ccusto' // funciona perfeitamente. Mas se uso o where abaixo WHERE descricao ='$ccusto' AND id_transfer ='$id_transfer' AND id...
asked by 22.02.2017 / 03:13
9
answers

How to prevent SQL injection in my PHP code?

I developed a page in PHP for internal use of the company I work with and only very few people use it. You can use this page to do some queries, insertions, changes and deletions of a table in a MySQL database, however I believe that my PHP code...
asked by 03.02.2014 / 13:37
0
answers

Problem with registration using PDO

I am creating a simple system to register in PDO (I am a beginner in this), and I am not succeeding in developing my connection string and in adjusting the INSERT to add data to the bank. It gives the following error:    Notice: Undefined...
asked by 09.03.2017 / 03:57
1
answer

Calculate duration in php

Hello, I have another problem and I need someone's help. The system I'm doing is for a school and I need my system to calculate the duration that each student had in class, so I know I need to use the (SUM) command inside my select, more and the...
asked by 08.03.2017 / 15:53
0
answers

AJAX does not update div by id

I am developing a login system, where I need to return the validation message to the user in a div on the login page itself, however the error message is appearing on the validation page. I am using Bootstrap and PHP with PDO Login.php: <...
asked by 10.03.2018 / 10:35
1
answer

Select JOIN + AVG () - Doubt with return

I'm solving an exercise but I'm having problems with the return: Question: Write the query that returns the vendor code, the vendor name, the number of products per vendor, and the average price for each vendor, only for vendors that have a...
asked by 10.03.2018 / 13:19
1
answer

Does MySQL work with more than one index?

If I have a query in a table: SELECT * FROM clientes WHERE empresa_id=10 AND datacad='2017-01-01' And two indexes, one in the 'empresa_id' column and the other in 'datacad' . Will MySQL use only one of the two, or is it able to us...
asked by 10.03.2018 / 18:46
1
answer

Search Field Query

I need to make a query that searches all records that have the term typed in an input , for example: Car, return car blue, green car, etc. .. My current query : $query = "SELECT * FROM veiculos WHERE nome = '$veiculo'"; Thank you   ...
asked by 14.02.2017 / 13:15
1
answer

Validate if there is already a registration in the bank before filling out the form

I have the following form: <form class="form-horizontal" action="cadastrar.php" method="GET"> <fieldset> <legend>DADOS CADASTRAIS</legend> <input type=...
asked by 11.04.2017 / 22:47