Questions tagged as 'mysql'

1
answer

If with two conditions

I need in a select to add a field, so I need to check two conditions, if the currency is 3 divide by the exchange, if the operation is 18 take the whole sum and multiply by -1. The select I have does sum by checking the currency, but I can not p...
asked by 07.11.2018 / 15:55
1
answer

Is it possible to search a data in the database without knowing which table it is in?

I have banco de dados too large and it is impractical to build a SELECT * FROM for each table and find the data I need.    If it is a texto especifico ('with as parameter 23') I have already looked in all ways and not   I...
asked by 29.01.2018 / 19:36
1
answer

Error deleting data in Mysql by Java

In the database I have three tables, where one of them holds the foreign keys. Error Displayed: Error: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Can not delete or update parent row: a foreign key constraint fail...
asked by 13.05.2018 / 21:32
1
answer

Avoid Duplication in the PHP + MySQLi Registry

Good evening! How do I prevent registration with the same information? Currently my "processa.php" is this way, and I wanted to include the function mentioned above ... <?php session_start(); include_once ("conexao.php"); $nome = fi...
asked by 03.09.2018 / 00:21
1
answer

Treatment "escape" in query (escape of characters)

Scenario: Insert Query: public function forward($descricao) { ($descricao == '') ? $descricao = 'NULL' : $descricao = "'{$descricao}'" ; $sql_enc = " INSERT INTO rg_encaminhamentos ('descricao') VALUES ($descricao) "; } I'm inse...
asked by 18.01.2018 / 13:02
1
answer

Use a connection for several methods in the same class and in others

Would you like to have only one connection and use it in multiple methods? For example: The prepared statement needs an open connection to run, so I do getConnection() , and another method also needs, so I have to do another getConnec...
asked by 17.12.2017 / 08:43
1
answer

How to ensure that all information has been recorded in the bank?

I've come to realize that I'm having trouble writing information to the bank because: -I am running a block of a method that writes data to the database: //codigo aqui MySQLCallDB.InsertData("PEDIDOS", columns, values); //gravando informaçõ...
asked by 08.08.2018 / 20:11
1
answer

Page bottom of page

I have a system that shows 8 data per page, my problem is that the pagination when only has a data on the page or 2 is on the data side, type: data 1 - data 2 - Page 1, I wanted it to stay at the end of the page as it happens when you have 8 dat...
asked by 06.12.2017 / 13:34
1
answer

Questions in GroupBy Query and Checkbox - Laravel 5.5

I'm developing in PHP in the Laravel 5.5 Framework and I have the following code to create my checkboxes. {{-- percorrendo a tabela para exibir os checks--}} @foreach($permissoes as $keys => $dados_permissoes)...
asked by 12.12.2017 / 20:04
1
answer

Uploading images larger than 2mb

I have a simple system that uploads the image to a folder and writes the name and url to the database. But when I select an image larger than 2mb of the error in the bootable destination that is equal to $ destination = folder / ".photo_name &...
asked by 18.11.2017 / 23:29