Most voted "mysql" questions
Mysql is a relational database management system (RDBMS) that functions as a server, and provides access to multiple users simultaneously. Your source code is available under the GNU General Public License.
Learn more…10,264 questions
Sort by count of
-
15
votes6
answers11947
viewsHow to create a password reset link?
I am developing a site that has user registration area, the password is encrypted to increase security on the site, but when the user forget the password how will it be possible to return his…
-
15
votes4
answers28026
viewsAccent in mysql select displaying question sign " "
Today I migrated my site to hostgator and happened this problem, the accents are all with some characters The files are all with correct accent in the database My collation in the database is as:…
-
15
votes2
answers2622
viewsWhat to save in a login session?
I am developing a login system in PHP and Mysql for an administration panel, and I have seen many "secure" login systems where they store in the session the user login or password, that is when they…
-
15
votes1
answer2407
viewsHow to update my Mysql code to Mysqli?
I have codes that use mysql and need to upgrade to mysqli. I need to make two changes, being them on the pages .php which insert the data into the database table and also into the pages displaying…
-
15
votes1
answer2041
viewsSQL LIMIT parameterized in PHP with PDO
A few days ago, I stopped using the functions mysql_*(already obsolete), and I switched to PDO. I have a function that does query database, but I’m having some problems using the LIMIT with Prepared…
-
15
votes3
answers14534
viewsWhat is the INDEX index in Mysql for?
What is the content for INDEX in Mysql? ALTER TABLE `tabela` ADD INDEX `tabela_id_index` (`tabela_id` ASC);
-
15
votes2
answers5421
viewsHow to validate each data type received from a form?
This subject has several related topics, and generates as many back and forth, each with a different answer. In some cases we have great answers, but no specific question about this question (in the…
-
15
votes2
answers286
viewsWhat is the use of the varchar(0) column type?
I saw a question about column length of type Varchar and went to consult a book I have and came across the following statement: The maximum length should be a number between 0 to 255. What is the…
mysqlasked 7 years, 8 months ago user60252 -
15
votes4
answers15459
viewsWhat is the difference between LIKE, IN and BETWEEN in Mysql?
I’m having doubts about the difference and use of tags LIKE, IN and BETWEEN in Mysql. When to use tags and example?
-
15
votes3
answers4552
viewsUse VARCHAR(255) for all fields or choose the best size for each field?
Assuming the following fields (for example): Nome, Rua, Cidade ,UF. The Nome would be the client’s name. There are people with 2 short names or people with 5 or more names, so it is possible to have…
-
14
votes8
answers26648
viewsHow to backup Mysql Database Diaries?
Is there any free tool, or even a script (.bat) that I can use to make a backup automatic from my database? I wish that backup was generated by saving a single file .sql.…
-
14
votes4
answers6297
viewsForm inserting twice in the bank (F5)
I have a great form that update and insert at various points when submitted. However, if in the time interval of this process the user presses F5, he duplicates the insertion record the number of…
-
14
votes6
answers14419
viewsWhich database should I use in a small desktop application?
I read a bit about the Meta and I thought that this question does not escape much from the current rules of the site. Risking losing reputation, come on: At the moment I work in a small company that…
-
14
votes4
answers10727
viewsWhat is the Mysql CREATE VIEW command for?
I wonder what the command is for CREATE VIEW mysql?
mysqlasked 10 years, 8 months ago Leandro Costa 2,172 -
14
votes6
answers11304
viewsHow to get distance given the coordinates using SQL?
I’m doing a function in php, in which, given a GPS coordinate, it will search in the database the recorded locations, which are not necessarily fixed, within a certain distance. My question is, how…
-
14
votes2
answers3471
viewsSearch with LIKE or MATCH.. AGAINST in two columns
I have a classified system where I do a search with PHP and Mysql using LIKE in two camps: campo1 like '' or campo2 like '' The problem is when I’m looking for something like, "Green car" it doesn’t…
-
14
votes2
answers13123
viewsIdentify if set of coordinates is within a radius on Android
I want to delimit a radius from a central coordinate (the red marker in the figure) and, from a set of coordinates (the green markers), check that these are within the area bounded by this radius.…
-
14
votes4
answers2074
viewsHow to get the format in hours when it exceeds 24?
I’m developing a PHP system where I need to get the total time of an audio file at some point. This time is saved in the database in seconds and also in the format of hours. The problem is that when…
-
14
votes2
answers36430
viewsUpdate with Inner Join
If I make a consult like update using the clause Inner Join, the update will affect all fields that satisfy the condition imposed on Inner Join or just the first field?…
-
14
votes2
answers314
views=, BINARY, LIKE, LIKE BINARY, REGEXP, SQL binary grouping
Reformulation of the question based on @Gabrielhenrique’s answer and research: What is binary grouping in a string column in the table? BINARY serves to make a case-sensitive search and LIKE…
-
13
votes5
answers53548
viewsMysql decimal value
I am trying to insert decimal value in mysql database, wanted to put these values for example: 1.500,00 Thousand, hundred and ten What is the type of column I must declare?…
-
13
votes1
answer27404
viewsDifference between CAST and CONVERT in Mysql
To solve a problem I came across two solutions where a function was used CAST() to convert a number into text, the function was used in another CONVERT() for the same purpose. The two functions, the…
-
13
votes6
answers4694
viewsHow to make a stopwatch continue counting after closing the page?
I need to create a stopwatch that is started through a play, but wanted a solution, other than by SESSION, to let you count even if the customer closes the window or drops his internet, ie that is…
-
13
votes3
answers9451
viewsWhat is the meaning of the sign || '-' || in SQL
I am performing a query in an Oracle database and come across this symbology || '-' ||, in my query. I’d like to know the meaning? Select xf0cdloc || '-' || XN4CDEMP AS LOCOMOTIVA, From Trem…
-
13
votes3
answers2365
viewsHow to verify if connected in the database?
how do I check my code PHP + PDO successfully connected to the database Mysql? With code like this it works: <?php /* Connect to a MySQL database using driver invocation */ $dsn =…
-
12
votes2
answers2445
viewsWhat is the syntax for searching with array as parameter in Mysql?
What is the correct syntax, if possible, to pass an array as parameter, using the FIND_IN_SET more or less in this idea: SELECT c.cpf FROM tbl_cliente as c WHERE FIND_IN_SET(array, c.cpf);…
-
12
votes3
answers1569
viewsHow to create multiple entries in an index based on columns in the same row?
I have never found a good way to index multiple columns of a row as index entries or simulate this feature in Mysql. The problem arises when you have fields working as tags or a similar concept.…
-
12
votes5
answers21638
viewsCurrency formatting to save to database as DECIMAL
I am using a mysql database, the format of the field is Decimal (7,2) and he gets his salary. Based on what the user types I store in the bank so: str_replace(',','.', $_POST['txtSalario']) Replace…
-
12
votes1
answer10002
viewsDifferences between Natural Join and Inner Join
What characteristics differentiate a consultation performed with the use of Natural Join other with the use of Inner Join? Is there any question related to performance or any other condition that…
-
12
votes3
answers2689
viewsHow to rename all tables in a Mysql database
I have a Mysql database with several tables and am migrating to another database. I have Client and must stay Cliente_pe I have product and should stay How can I accomplish this without however…
-
12
votes4
answers15034
viewsDifference between mysql_connect() and mysqli_connect() functions in PHP
I wanted to know the difference between the two and which is the best one to use. $x= mysqli_connect("localhost","my_user","my_password","my_db"); $y= mysql_connect("localhost", "my_user",…
-
12
votes2
answers1942
viewsHow to insert EMOJI - SMARTFONES into Mysql database with PHP?
Well, since the question is very self-explanatory I will only reinforce the question. I have an APP chat system, which through the HTML, command to PHP with Ajax, but if the usurer tries to insert…
-
12
votes2
answers23371
viewsHow does the BLOB field work?
Hello, directly asking, how does this kind of field work? I know there are three types: BLOB = 64KB, MEDIUMBLOB = 16MB and LONGBLOB = 4GB Given this example: CREATE TABLE COMPROMISSOS ( ID INTEGER…
-
12
votes2
answers613
viewsDynamically delete multiple lines with PDO?
Let’s say I have a user table (id | nome) and that where they are listed (client-side) i can select several of them and delete them at the same time. How could I do this in a Mysql database using…
-
12
votes2
answers736
views -
12
votes3
answers2531
viewsHow to select all columns except one in particular?
There is the possibility to select all columns of a table: SELECT * FROM wp_rw_programacao WHERE id = $id But I need to eliminate the result of the column id. It is possible?…
-
12
votes1
answer4323
viewsWhat is the purpose of the JSON column in MYSQL?
I realized that Mysql has released a new feature, which is the column can have the type JSON (which can even be saved in binary, as I was reading). Documentation: As of Mysql 5.7.8, Mysql Supports a…
-
12
votes1
answer398
viewsWhy does the SQL language vary from DBMS to DBMS?
I was used to using SQL for Web projects, always using Mysql. One day I had to write a C++ program that used databases. At first I chose Sqlite but needed other computers in the network to connect…
-
12
votes3
answers327
viewsQuery to get 1024 sum in maximum 3 transactions
I want to display people’s names (recipient) who received at least 1024 in a maximum of 3 transactions. Here the table "transfers": sender | recipient | date | amount…
mysqlasked 7 years, 7 months ago zwitterion 2,876 -
12
votes2
answers312
viewsOptimization of SQL code
How can I optimize the following code to not use 3 Selects and not plaster the query to only 3 status ( SELECT * FROM historico WHERE his_status = 'FRACASSO' ORDER BY his_data DESC LIMIT 50 ) UNION…
-
12
votes5
answers35616
viewsSELECT condition WHERE with multiple values in the same column
I have two tables in my bank and perform JOIN with them. A table is a list of people and the other characteristic list of that person. By logic there is only one person and each person can have…
-
11
votes6
answers57963
viewsHow to convert UTF-8 characters in PHP
In my web application, I am using a Mysql database that has the table EditableContent. This table has the field content, who’s kind text and has as input format utf8-bin. In the database the…
-
11
votes3
answers9405
viewsHow to convert a Mysql connection to Mysqli?
I decided to listen to some users to make the conversion but I need your help because I have done a lot of research and nothing works. The first file is: <?php…
-
11
votes3
answers3031
viewsWhat better way to create an app that works offline and automatically encrypt data with a server?
I’m deepening into the world Mobile, where I had the first challenge, which is to create a App Android basic registration, name, age, etc. The tricky (at least for me) is that I have to update this…
-
11
votes2
answers32556
viewsHow to remove duplicate lines efficiently?
I’m normalizing a table here and found that there are duplicate lines. The way I chose to clear these lines is through the: CREATE TABLE tabela_nova AS ( SELECT DISTINCT * FROM tabela_antiga ); The…
-
11
votes1
answer1604
viewsHow to concatenate an SQL command into a Mysql Stored Procedure?
In the following show, we have an example already running in PHP. The scenario of the question is the assembly of a "navigation link" based on a data structure. $node = '006002009'; // Esta…
-
11
votes3
answers5016
viewsForm validation in modal using Bootstrap
I have the following question. I have a simple record and I want you to tell me when registering a new record: If the field is empty it shows me the message "Fill in the fields"; If the form field…
-
11
votes2
answers10914
viewsData type for latitude and longitude
I am working on a new project where I will need to save the coordinates (latitude and longitude) of an address in the database. There is an ideal data type for this? I searched and saw some decimal…
-
11
votes2
answers3018
viewsIs it really necessary to create an auxiliary 3rd table in N-N relationships?
In several places I see that when you have a relationship N-N (if I remember correctly) it is recommended to create a 3rd auxiliary table and then later it will be transformed into a relationship 1…
-
10
votes1
answer3389
viewsHow to receive a notification whenever there is a new record in a database table?
I need to receive a notification whenever there is a new record in a particular database table, which I can do to receive ? If I use one Trigger Mysql will not work when I change database. If I make…