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
-
6
votes1
answer2258
viewsHow to fix the unrecognized Attribute 'name' error in Webconfig?
I am developing a web project in VS 2012, this application connects with a Mysql database developed in Mysqlworkbench 60 CE with Mysql server 5.6, I have referenced in the project the…
-
6
votes3
answers25254
viewsSubtract date and display in YEARS, MONTHS and DAYS
SGBD: Mysql Problem: How to replace the current date with a specific date and return the value in YEARS, MONTHS and DAYS in a query? Example: DADOS DataAdmissao dataAtual 2010-04-07 2014-06-27 (este…
-
6
votes2
answers1104
viewsWhat is the best way to upload files with Ajax?
I could take a code on the Internet paste here and try an answer but I prefer that help me with the logic and programming of a script to upload images in Ajax. I don’t know how to start, I’m a…
-
6
votes2
answers2655
viewsDependencies in the same table
A funeral home asked me to do a simple customer registration scheme for them. A client may have several dependents who benefit from their contracted plan if they die. I am in doubt about the data…
-
6
votes1
answer2102
viewsHow not to enter repeated records?
I’m making a login system in which each user creates a URL that sends to the bank, only that I need to make it does not repeat information, if there is already similar information in the bank it…
-
6
votes2
answers1061
viewsHow to send data from a php filter with multiple search fields
I am creating a filter page, but this page will have many fields for the user to fill, select and this will make a search in the bank mysql and will return the data to the user on another page. One…
-
6
votes1
answer616
viewsQuery to join one column from another
I have tried unsuccessfully to get a result. I have the table with the following login and logout information: |Group |User |EventDate |Event |Camp ------------------------ |Evolution |1012…
-
6
votes2
answers640
viewsHow to print the SQL statement that is being sent to the database?
I would like to know how to printout an SQL for the purpose of controlling the statement being sent to the database: $sql = $pdo->query("SELECT * FROM imovel WEHRE CATEGORIA = 'APARTAMENTO'");…
-
6
votes2
answers3966
viewsHow to send checkbox data to a mysql query?
I don’t know how to start this whole process of sending multiple data for a query in the database. I always send an item from each guys but I never sent several items of the same guy. The image…
-
6
votes4
answers817
viewsSQL Condition Array - PHP
good afternoon, I am sending a search filter to my BD, and I want to make these conditions within an array, for example: $condicoes = array(); $nome = $_GET['nome']; if (!empty($nome)) { $condicoes…
-
6
votes3
answers780
viewsIs it feasible to change databases in an existing system?
I’m starting a project in ASP.NET MVC 5 with Entity Framework for a customer, where the customer has chosen to use a free database, in this case the Mysql. However, with the growth of the…
mysql asp.net-mvc entity-framework software-architectureasked 10 years, 2 months ago Erico Souza 2,188 -
6
votes2
answers240
viewsSearch returns equal data
I’m making a search system where there are some fields (conditions) to search and find the results. These fields are not mandatory, if the person type something he will find by the data entered, if…
-
6
votes4
answers53244
viewsDifferent ways to count record numbers in Mysql
There’s a difference in performance if you do: //seleciona todos os itens da tabela $cmd = "SELECT * FROM produtos"; $produtos = mysql_query($cmd); //conta o total de itens $total =…
-
6
votes1
answer2821
viewsHow to limit the number of pages shown in a pagination?
With this question that already has solution, I got as a result a paginação com PDO but I have one more problem that will possibly be the subject of a reward next week. As you can see in the image…
-
6
votes1
answer178
viewsWhy does the group_concat of primary keys (integers) generate a BLOB as a result?
Trying to answer this issue (as the AP even presented, without resorting to normalization) I tried to use the group_concat it returns me the object of type BLOB. Table: CREATE TABLE `teste` ( `id`…
-
6
votes1
answer3596
viewsInterpret the Mysql Explain command
I have a query that is taking 6/8 seconds to execute. The database I’m using is Mysql. In Phpmyadmin I did the following: EXPLAIN SELECT id_categoria, sc.categoria, categoria_principal, associada…
-
6
votes1
answer3098
viewsHow to customize Auto_increment numbering in Mysql?
I have a column Contrato in my Mysql database, it is like Auto_Increment, by numbering the contracts as 1, 2, 3... But I needed, if possible, to organize these numbers in the actual format of…
-
6
votes3
answers8025
viewsDifference between decimal and Numeric
The two types of data, DECIMAL and NUMERIC, are/can be used to store exact values. For example: Is there any difference between Salario DECIMAL(5,2) and Salario NUMERIC(5,2) in Mysql? Is there any…
-
6
votes3
answers3470
viewsGROUP BY last entry
I’m making an appointment at the bank, follow my table below id | protocolo | status | alteracao | datahora 1 2 1 teste 2014-11-10 15:23:44 2 2 3 teste 2014-11-10 14:23:44 3 2 4 teste 2014-11-10…
-
6
votes1
answer268
viewsWhat size of a large sizeable query?
What size of a query considerable great? For, I need to make a function to send query for the server but I cannot exceed the limit not to crash the server: public function sqlExecute($sql_code) { if…
-
6
votes3
answers1890
viewsQuery two tables in Mysql
My situation is as follows: I have several tables that have some common information, such as UNIT. In one of these tables I have all my units and I need to check if this same UNIT also exists in…
-
6
votes1
answer276
viewsHow to convert a date to this format in PHP?
Can anyone tell me what kind of date this format is? 2013-09-17T05:59:00+01:00 I have in the database a timestamp or date field. How to convert its value to this format using PHP?…
-
6
votes3
answers641
viewsHow to connect to Mysql only once, without having to instantiate every time?
How do I connect to Mysql only once, without writing it again in every function? Currently I do so: class Site { var $driver; var $host; var $dbname; var $user; var $pass; public function…
-
6
votes1
answer4666
viewsHow to save checkbox options in the bank?
I need to save the fruits and values in different fields in the bank" PHP: <?php session_start(); //if (!isset($_SESSION["usuario"])){echo "<script>alert('O SEU INGRESSO É…
-
6
votes1
answer187
viewsI cannot display the SQL value
I am trying to start a connection to the Mysql database and it works, but when I ask PHP to display what is there nothing appears. It’s like the connection to the BD had failed. <?php //…
-
6
votes3
answers766
views -
6
votes1
answer54
viewsRelationships Does EDMX only affect performance?
I have a question about the Entity Framework. Here at the company where I work, the tables are generated in the bank without any relationship, until the fields are created that will be foreign keys…
-
6
votes1
answer3433
viewsSlideshow with Mysql BLOB Images
I am mounting an image manager and I need to display these images on a TV, through the browser by a slideshow. I can assemble a slide show setting each image address, but I have several images in…
-
6
votes2
answers262
viewsInsert data into database according to number of checkboxes
I have a form where I have fields with chekboxes and I want to know if it is possible to do so many inserts as selected fields. That is if the user selects 4 checkboxes do 4 inserts, is possible? If…
-
6
votes2
answers1068
views2 Foreign key in one field
Good, I have 3 tables: Athlete Id (Pk) Name Athlete Id (PK) Name Nfed Escorts Id (PK) Name Type Athlete (FK) The field Athlete on the table Escorts is the Id table Athlete and table Athlete. How do…
mysqlasked 9 years, 5 months ago Bruno Gibellino 1,110 -
6
votes3
answers11729
viewsInsert line break in field text into database
I have a table with a field type text, the field stores a string imported via archive .csv, the same was inserted without line break and I’m trying to insert it, I was able to identify that the line…
-
6
votes1
answer609
viewsMysql JOIN with or without Foreign key?
What’s the difference between relating 2 tables using and not using a Foreign key? With regard to performance, it is recommended to use Foreign key to make the relationship? In which situation would…
-
6
votes1
answer385
viewsProblem with long Polling
Well I did one here script to fetch information from real-time posts the database but it works if I add it directly in Mysql works well but the page when I go to insert a text does not work with…
-
6
votes2
answers2437
viewsHow to properly save an image URL in Mysql database?
I am testing the targeting of images with the URL. However, during the tests, the URL was returned with changes as can be seen below: URL inserted in the database:…
-
6
votes3
answers71632
viewsHow to make a select in the bank not to bring repeated values?
For example have in the table the values: green, red, blue, blue, pink, pink, pink, yellow. I would need to return from the colors table only once the blue and the pink. Is there any way to do this?…
-
6
votes2
answers533
viewsMysql BD random record preventing consecutive equal records
I have a database where I want to pick up a random record. I can do this perfectly with: $query = "SELECT * FROM `mytable` ORDER BY RAND() The problem is that the database contains the entry order…
-
6
votes2
answers1087
viewsA Mysql query, with`crases` vs without
With aces to query is safer or less? $Query = "Select * from `tabela` WHERE `id` = `1`"; vs $Query = "Select * from tabela WHERE id = 1";
-
6
votes1
answer180
viewsSelect database record for variable
The code below aims to select a database record and save it in a variable for later use of the data: #!/bin/bash dbName='basedados' dbUser='utilizador' dbPass='password' row=$(echo "select file_id,…
-
6
votes2
answers853
viewsNormalize values separated by comma for new table
The idea is to stop having the column with the values separated by comma and pass them to an intermediate table: Source table Assuming a table with the name press with the following fields: id,…
-
6
votes1
answer2147
viewsPass variable value inside nested SELECT
Assuming the following query where we are selecting values, grouping them and then re-grouping the result: SELECT CONCAT (b.label, '|', b.slug) FROM ( SELECT group_concat(name SEPARATOR '$') AS…
-
6
votes3
answers2715
viewsIs there any way to display the size of the string in a MYSQL result?
Is there any way to display the string size in a MYSQL result? I need, for example, to know the size of a given string returned in a SELECT with group_concat. What I want would be more or less like…
mysqlasked 9 years, 2 months ago Wallace Maxters 102,340 -
6
votes2
answers461
viewsHow to sort the results of a ranking?
I am developing a game, and in it I need to make a ranking according to the time it took the user to reach the end of the game. My question is the following: what kind of data should I use in my…
-
6
votes1
answer402
viewsselect like over 3 million lines
I have a Maxmind table, with more than 3 million cities. I created the indexes for a simple select and is at satisfactory performance. The problem is that I am using an autocomplete and for that my…
-
6
votes2
answers558
viewsWhat is the undescore "_" in the MYSQL LIKE?
In a previous question regarding LIKE in the MYSQL, I should avoid the injection of "%" in a query where I use "LIKE"?, a question has arisen regarding the _ (undescore) can be used on the operator…
-
6
votes1
answer92
viewsDoes not insert data into database
Good people, I have this code, and the thing is that since I entered the part to upload an image it doesn’t send anything to the database. Not a new line creates, nothing at all. Someone can help…
-
6
votes3
answers17415
viewsMysql field type change
I wonder if it is possible to change the data type of a column in Mysql. For example: I have a table USUARIO with the column SITUACAO, in varchar and need to change to bit. I thought I’d do…
-
6
votes2
answers355
viewsUpdate dlls in client
I have a software that communicates with a Mysql 4.1.14 database. I installed a new server for Mysql 5.6 tests, but when I communicate with the new database, the message appears stating that the…
-
6
votes2
answers64
viewshow do I return two times using the COUNT(*) function
SELECT COUNT(*) AS contador, hora_efetivada FROM minha_tabela WHERE status=2 I have a counter that returns the total value of status 2 in the database, but in my name column hora_efetivada there are…
-
6
votes2
answers2492
viewsJOIN with two columns in the same table
Good morning. How can I make a two column JOIN in the same table? On the table quotation, has the column with cpf_cnpj from warhead and fate. SELECT cotacao.*, clienteOrigem.ID_Cliente as…
-
6
votes1
answer5018
viewsHow to Insert/Recover Image in Mysql Database
I would like to know in a clear and simple way how to insert/recover image in Mysql database? I’m using Firedac to connect to the Mysql database. I have a JPEG image and want to save it in a Mysql…