Questions tagged as 'mysql'

1
answer

SQL Query on Loops is good practice?

Is query set with Where or other sql commands inside loops like Foreach good practice or not recommended at all? Is there a better way to handle the data without having to make so many calls in the database?     
asked by 30.07.2014 / 14:11
2
answers

How to make a "LIKE" in a DJANGO ORM query?

To make a query to get the data exactly in Django, I use filter , like this: usuarios = Usuarios.objects.filter(nome='Jonh') This will generate a SQL similar to: SELECT * FROM usuarios wHERE nome = 'Jonh' Since I've been using Dj...
asked by 15.02.2018 / 14:03
2
answers

Column 'XXX' in field list is ambiguous

I'm having trouble executing the following Query: SELECT product_id, presentation FROM Variant INNER JOIN productCategory ON product_id = product_id LIMIT 10; Error: ERROR 1052 (23000): Column 'product_id' in field list is am...
asked by 12.12.2017 / 19:47
1
answer

Function in MySQL to return text according to numeric index

I have a table named tb_usuarios with columns id_usuario nome email telefone tipo_de_acesso I would like to create a function in MySQL, where when using echo $row['tipo_de_acesso'] , the correct type already exists, but in text...
asked by 10.04.2017 / 21:11
3
answers

Why does GROUP BY not work with MySQL in this case?

I'm using the MySQL language and am trying to group a profession table with GROUP BY through the query below. SELECT name, occupation FROM OCCUPATIONS GROUP BY occupation; But I get this error when trying to group the professions....
asked by 02.12.2017 / 19:37
2
answers

Correct way to perform a dynamic UPDATE with PHP in MySQL

What is the right way to do% dynamic%? The big problem is to be dynamic, if I pass only the first parameter and others do not change. What is the best way to leave this update only with the parameter I am changing without the need to pass...
asked by 09.10.2014 / 00:32
2
answers

How to add jQuery data in a table?

How to get jQuery the sum of all the class="subtotal1" fields returned from the database? <?php while($M_P = mysql_fetch_array($Dados_Produtos)) { ?> <tr class="somatoria"> <td><?=utf8_encode($M_P['produ...
asked by 15.10.2014 / 04:40
3
answers

Filters with PHP - Search Form

How could I make a filter like that of the example image? The part of the tables with the data and SELECT to look for is quiet. What I'm suffering from is how to assemble PHP code for this, maybe someone has a way for me to learn how t...
asked by 12.09.2015 / 23:53
2
answers

INSERT in two different tables - MySql

I have two tables in Mysql: Alunos: id, nome, idade, email, senha. login: id, email, senha. When I insert to write the information in the alunos table, can I make another insert to write the email and password in l...
asked by 03.10.2015 / 21:04
2
answers

What is the space limit of each database in mysql

I see that some SGBD's has a defined space limit for each Database. As in the case of the Express version of SQL Server that provides 10GB for each Base. I would like to know if MySql has any limits, and if a heavy bank can...
asked by 15.05.2015 / 16:24