Questions tagged as 'mysql'

2
answers

Why does the if or case test not work in this subquery?

I'm trying to run the following subquery inside a view: (SELECT if(idnotas > 0, "não", "sim") FROM notas WHERE vendas_idvendas = p.vendas_idvendas ORDER BY idnotas DESC LIMIT 1 ) as primeiraFatura, Howeve...
asked by 27.12.2018 / 12:49
1
answer

Export Excel Data PHP Variable Workbench

I'm having second thoughts about generating an excel with the query. <?php include("conectar.php"); $id = $_GET['id']; $arquivo = 'Não autorizado .xls'; First question: In the $ share part, can I put a variable to rename the file? // -...
asked by 28.05.2014 / 10:45
1
answer

Safe Updates in PHPMyAdmin

In MySQL Workbench it has a very useful function called: "Safe Updates", which prevents Updates in a column without WHERE, for example. In PHPMyAdmin, does this function exist? I could not find it.     
asked by 02.06.2014 / 16:58
1
answer

Converting data into types such as int and double

I'm having trouble converting data from a database, for example I'm running a query like this: carteira ca = bc.carteira.FirstOrDefault(obj => obj.cpf == cepf && obj.codigo == cod); I get data information of type ca.valor ,...
asked by 02.06.2014 / 23:32
0
answers

Truncated incorrect DOUBLE value. What error is that?

On this page I select the book id to display it and then refresh the visits field by incrementing it. <?php if(isset($_GET['id'])) { $id = $_GET['id']; } $livros = mysqli_query($conexao, "SELECT nome, descricao, imagem, download, vis...
asked by 29.10.2018 / 21:09
2
answers

Query does not work inside php [closed]

I made a query with a join to get information from the database, I tested it in mysql and it worked perfectly, the problem is that it does not work in php, not the execution error but the return is nullo, even if I change the I have used var_dum...
asked by 06.11.2018 / 03:37
1
answer

Bring "child" records count next to all table records

How do I count how many "children" that row has, and at the same time list all records in the table? I have the categorias table, with the following data: _________________________________ | id (PK) | nome | id_pai (FK) | --------...
asked by 11.03.2015 / 15:52
1
answer

How to keep data updated in two tables?

There are two tables that should be kept up to date in different banks, "User" database "DB1" and "User" from the "DB2". In this case, it would be the "password" field to be updated. I have a Trigger BEFORE UPDATE in the database "BD1" that is f...
asked by 13.03.2015 / 21:55
3
answers

Is it possible to convert multiple tables from MyISAM to InnoDB at the same time?

I need to convert several tables created with MyISAM engine to InnoDB engine. There are about 250 tables and I would like to know if you can convert them all at once through the mysql command line or phpmyadmin. Converting I know it's possibl...
asked by 17.02.2014 / 22:58
0
answers

Method to subtract two values from the sum of the records coming from the MySQL database

Good afternoon everyone, I'm creating a class that will work as a box where it will add all the records found in the database with the column in the value of IN and OUT and in the end I subtract Input - Output but is not working anyone can te...
asked by 20.09.2018 / 22:01