Questions tagged as 'mysql'

3
answers

Search the data for the last 7 days from the current date

I am making a query to DB, and I want to receive results for the last 7 days from the current date. For this, I have a data field of type DATA (yyyy-mm-dd) in the table. I'm doing the query in php, mysql turn. $query = mysql_query(SELEC...
asked by 14.03.2014 / 12:59
3
answers

PHP and MySQL, how thousands of connections are processed at the same time?

Using PHP and MySQL as an example, let's assume that there are 1000 connections (clients) accessing the site and using functions that open connection to MySQL and make queries. How do PHP and MySQL process so many connections and queries at the...
asked by 24.05.2014 / 18:06
2
answers

Change the collation and character set of the database, tables and corresponding columns

Some older projects were thought of in their immediate purpose and based on this the databases, tables and columns were prepared in a way limited to the intended scenario. In the sense of updating and adapting to a greater scalability of thes...
asked by 28.02.2014 / 22:51
1
answer

Query indexes in MySQL

Using indexes in mysql queries actually makes the result come quickly for some large queries or tables. For example in the query below: SELECT * FROM table WHERE status = 1; For a table with 1 million records if I give the command below:...
asked by 10.09.2014 / 15:33
1
answer

What is REPLACE INTO in MYSQL?

What is the purpose of the REPLACE INTO command in MYSQL? Example: REPLACE INTO tabela(col1, col2) values(value1, value2) WHERE id = 1     
asked by 03.02.2016 / 13:49
1
answer

Which collate UTF-8 is most appropriate for Web (multi-language)

I usually use utf8_general_ci by default in my projects, however recently I came across that other developers usually use utf8_unicode_ci utf8_general_ci : Unicode (multi-language), case insensitive utf8_unicode_ci...
asked by 08.12.2014 / 19:22
2
answers

What is the utility of the varchar (0) column type?

I saw a question about column length of type Varchar and I went to consult a book that I have and I came across the following statement: The maximum length should be a number between 0 to 255. What is the utility of the zero-length va...
asked by 21.03.2017 / 14:10
2
answers

Result difference between MySql 5.5 and MariaDB 5.5

I have a query running on my site that has Mysql 5.5.43 installed, but when I went up on the server (which has MariaDB 5.5.38 and I only know it now) the query does not return the same result, I would like to know if anyone could t...
asked by 01.07.2015 / 05:49
6
answers

How to get distance given the coordinates using SQL?

I'm making a function in php , in which, given a GPS coordinate, it will search the database for registered locations, which are not necessarily fixed, within a certain distance. My question is: how do I calculate the distance between the co...
asked by 13.03.2014 / 13:19
3
answers

What is the meaning of the symbol || '-' || in SQL

I'm doing a query in an Oracle database and I come across this || '-' || symbology in my query . Would you like to know the meaning? Select xf0cdloc || '-' || XN4CDEMP AS LOCOMOTIVA, From Trem     
asked by 31.01.2017 / 14:07