Questions tagged as 'mysql'

1
answer

How to pass an SQL expression to an UPDATE by Zend?

My MySQL DBMS has a table called elements where one of the fields is called posicao and is of type int (6) . I need to perform an update (SQL) where the posicao field should be updated with its own value subtracting 1 acco...
asked by 14.03.2014 / 23:20
1
answer

JSON for PHP + MYSQL

My client sent me this JSON so I can loop and write the data in Mysql. I just can not get it because it's different from what I work on; Someone can give me some hint and what is the difference from one format to another. Error presented i...
asked by 06.06.2018 / 16:58
4
answers

The WHERE clause order interferes with performance?

Recently I did tests on a database with a query using two clauses where AND. I noticed that there was a significant difference using clause A before B and vice versa. Intuitively, it would be faster to use FIRST the more restrictive criterion...
asked by 22.12.2014 / 19:01
0
answers

I changed a value in the database and I do not have backups

Well I've unintentionally changed a value in the database that is important and I do not have backups. Is there anything I can do to recover?     
asked by 11.05.2018 / 11:34
0
answers

What are the best practices for putting mongoDB into production?

I'm studying node.js, and in most courses the staff uses mongoDB, I really enjoyed working with it, very simple and practical, but I have some doubts: Nowadays, do most of the hosting already support MongoDB? How to tell if the project is...
asked by 09.05.2018 / 03:19
2
answers

How do I get the position of a user individually in a rank, if in the database I only have your score?

With the code below I can display all users, because I put DESC and variable $num and it increments the placement with $num++; . But what if I want to get the / rank from the guy who is logged in ($_SESSION) and n...
asked by 30.04.2014 / 18:24
0
answers

Composite key in laravel migrate

I would like to create a double primary key with an auto increment field "id" and "id_lement_time", but it gives error and I do not know the correct way to do it, if someone can help me, I would appreciate it! > Migrate Schema::create('disci...
asked by 18.05.2018 / 00:44
1
answer

Query to get errors and hits from a student

I would like a query to get errors and hits from a particular student from the following table below:     
asked by 15.05.2018 / 22:15
2
answers

Creation of tables with cardinality 1: N

I have two tables, PRODUTOS and INSUMOS . To create a precise product of various inputs, I would like to know how to proceed with this relationship in MySQL. Should I create a table called COMPOSICAO and work on it only with...
asked by 30.08.2018 / 20:26
1
answer

Sql of default search per phpmyadmin string

I need to get the same result from a table search that returns the same portion of string and disregards the graphical accent of the search.     
asked by 20.04.2018 / 17:31