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
-
5
votes2
answers1023
viewsError creating a Mysql table
I created a table in Power Designer as shown below create table BANCO ( COD_BANCO integer not null auto_increment, NOME_BANCO varchar(50), AGENCIA_BANCO integer, CONTA_BANCO integer, GERENTE_BANCO…
-
5
votes1
answer5102
viewsRelate two mysql tables to data from the same column?
I am creating a 2014 World Cup table. I created two tables. times (ID, nome, sigla, bandeira) jogos (ID, fase, local, time1_id, time2_id, data) I have a relatively simple problem, but I found no…
-
5
votes5
answers6853
viewsConvert Date field data to Mysql month
In a comic book table I have a 'Data' field (0000-00-00) and I need to do the following: Create a field next to 'Month' that takes the date Ex: 2014-08-27 and pass the value 'August' to the month…
-
5
votes1
answer903
viewsHow to check SQL backup integrity
I’m using MySQL and, to back up the banks, I am using the mysqldump. My question is whether and how I can check if the file generated by the dump is intact automatically, without having to "upload"…
-
5
votes2
answers427
viewsView "View" from Postgres in Mysql. Is it possible? How to Do?
Is there any way to view a View created in Postgres and view in Mysql? If so, how to configure?
-
5
votes1
answer761
viewsWhat is the best way to read an XML in PHP and insert it into the Database?
I am reading XML files of about 50M of information (a hundred thousand records, could be more), and I have two classes implemented XML reading one DOM and another SAX. I’m having a problem in terms…
-
5
votes1
answer1137
viewsFind ID in a delimiter-separated ID column in Mysql
I use a table called chat and inside it has a whole structure for my chat script and I’m trying to create chat in groups, so far so good. However, within the table chat has a column called…
-
5
votes3
answers6817
viewsRecover Mysql Table
I reinstalled WAMP and did not export the database (.sql), but I have the files ". ibd" and ". frm". After the installation, I created a blank database and copied to the folder all the files ". ibd"…
-
5
votes1
answer167
viewsDoubt with relational modeling
I’m setting up a land registry, where these properties belong to an address, which belongs to a neighborhood that belongs to a city. Ex tables: Imoveis: id, endereco_id, etc... Enderecos: id, nome,…
-
5
votes1
answer749
viewsQuery in mysql with hierarchy
I have a table called 'departments' with the following structure: CREATE TABLE `departments` ( `id` tinyint(255) NOT NULL AUTO_INCREMENT, `company_id` tinyint(255) NOT NULL, `name` varchar(255) NOT…
-
5
votes1
answer5408
viewsMysql Error 1153: Got a Packet Bigger than 'max_allowed_packet' bytes
When trying to import a database from a dump with 1.2GB, the following error occurred: ERROR 1153 (08S01) at line 727: Got a Packet Bigger than 'max_allowed_packet' bytes The command I am using for…
mysqlasked 10 years, 1 month ago bfavaretto 64,705 -
5
votes1
answer1198
viewsBest way to model a chat database
I have an application that works with webservices and mysql database, I’m putting a chat in it, the part about how to pick up messages, display notifications and search for users I already have, my…
-
5
votes2
answers544
viewsRank database [#1 of 10]
I need to rank the DB records during paging. I don’t intend to create a field for ranking at first. Assuming I have 10 records 1) Ordenando a paginação por AZ, quero listar com o número…
-
5
votes3
answers13793
viewsDate in dd/mm/yyyy format?
i created a table, where I put the user record on a card for printing; therefore this table has several records (5 per page) and so in each page I access a record in the same table I did an…
-
5
votes2
answers5263
viewsHow to calculate the difference between values that are in the same column?
I would like to know if there is any way to calculate the difference between values that are in the same column. For example: I have a table with 2 fields: date and balance. I need to add a new…
-
5
votes5
answers45344
viewsAccess website on local network through my Android phone
I made a site in PHP and Mysql responsive and would like to access it on my Android phone by localhost, I know I have to put my IP on browser but when I send access it appears the following error:…
-
5
votes1
answer3713
viewsHow do I enable "explicit_defaults_for_timestamp"?
I installed Mysql Server 5.6. When I try to connect the Mysql server by running mysqld.exe, I get the following message: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use…
-
5
votes2
answers2318
viewsHow to make a mysql query from an array coming from html?
I know that $cores me return the form values. What is the best way to make a query in the database with the array values $cores to pick up the cars that are present in that color? <?php //PHP…
-
5
votes2
answers1801
viewsAvoid duplicate data by applying use log counter
In a simple form that saves the following data: ID, IP, Date/Time, Name, Email, State/City. When a person fills in the form, this data is recorded in the database. But if the same user fills in the…
-
5
votes1
answer1390
viewsHow to insert into a database with special characters?
Here’s what I’m doing INSERT: $result = mysql_query("INSERT INTO tbl_livro VALUES (NULL, '$titulo', '$autor_livro')"); What happens is that there are authors who have names with special characters,…
-
5
votes3
answers1627
viewsHow do you set zero or null in an SQL query of a date range, for those whose value does not exist?
Formulating the question was a little difficult, but I will try to be as explicit as possible using an example to put the question. There are the following data in my table: The aim is to carry out…
-
5
votes3
answers1142
viewsAdapt query to create VIEW that returns sum of count of two Subqueries
Of agreement with the documentation, Mysql does not allow the use of Subqueries in the FROM when the consultation is a view: Subqueries cannot be used in the FROM clause of a view. Resulting in the…
-
5
votes1
answer2172
viewsRevoke privileges
I have a database and I’m trying to make sure that only my user has access to this base. ie no one else can open, search, delete anything. I’m using the following syntax: GRANT USAGE ON batabase.*…
-
5
votes2
answers1861
viewsHow to refresh page and not send duplicate data to PHP database?
I would like to know if anyone has an example or can explain to me in the following question: In case the user refreshes the page, after sending the first form, the data is not sent again to Mysql.…
-
5
votes3
answers2269
viewsWhat is the most efficient way to select items from a table?
Having the following table: | id | name | email | coutry | +----+------+-------+--------+ What shape more efficient (faster) to select ALL the rows of the table knowing that the table may have 1 row…
-
5
votes2
answers880
viewsDuplicate value in table. How to remove?
I inserted some TSE tables in my database and have duplicate column values SQ_CANDIDATO representing the image above. How can I do a maintenance with sql who will remove ALL the duplicated values…
-
5
votes1
answer3110
viewsUse Javascript/Google Maps database addresses
I have in a database the following columns: customer name, active or inactive, address and coordinates lat and lng. I need to develop a PHP application that will display green markers in Google Maps…
-
5
votes1
answer4311
viewsDynamic search with JSON - PHP - MYSQL
I’ve been looking on the internet but I couldn’t find any references, maybe because I was searching wrong, so I resorted to create this post. I have a query in the database (Mysql with PHP) that…
-
5
votes2
answers33357
viewsHow to get the current date in Mysql?
I intend to create an event so that every hour will see if the expiration date of the announcement is higher than the current date, in this case it will have to change a theme of this announcement…
mysqlasked 9 years, 6 months ago Pedro Piloto 441 -
5
votes4
answers1841
viewsDoes the order of the WHERE clauses interfere with performance?
I recently ran some tests on a database with a query using two Where AND clauses. I noticed that there was a significant difference using clause A before clause B and vice versa. Intuitively, it…
-
5
votes1
answer751
viewsIndexing of Database
What is the advantage of maintaining an indexed database, with Foreign key and indexing of the most used fields as in searches?
-
5
votes1
answer688
viewsMysql Backup with Event Scheduler
I would like some tip on how to backup a mysql database with Event Scheduler. I only got in my searches, find Event to back up tables individually. I wish I could back up the whole bank, someone can…
-
5
votes1
answer403
viewsProblem summing column values and displaying in highcharts
I have the table: numitens | data | email 1 | 01/01/15 | [email protected] 1 | 01/01/15 | [email protected] 2 | 01/01/15 | [email protected] 1 | 02/01/15 | [email protected] The format you…
-
5
votes1
answer326
viewsSELECT with sequential counter does not accept LEFT JOIN
Because by making a SELECT that returns a Sequence number doesn’t work if you have LEFT JOIN? SELECT @ROW_NUMBER:=@ROW_NUMBER+1 AS ROW_NUMBER, P.PEDIDOID FROM PEDIDO AS P, (SELECT @ROW_NUMBER:=0) AS…
-
5
votes1
answer1029
viewsAllow access to a PHP page only 1 user at a time
I’m creating a call answering system, and to avoid confusion when it comes to answering a request, I need to restrict the PHP page that contains the call data to 1 access at a time for each user of…
-
5
votes1
answer1178
viewsHow to filter a SELECT with n:m and bring all characteristics?
I’m using n:m to create a system of attributes/characteristics for certain products, so I can reuse the same attributes for more than one product, the table is something like: When I run a SELECT…
-
5
votes1
answer1837
viewsWhat are the differences between a Datatable and a Datareader for Mysql queries in C#?
I am creating a C# project with Mysql, my connector follows the standard Singleton and use Mysqldatareader to recover the table data and popular a List so far ok. My problem started when I had to…
-
5
votes3
answers7043
viewsHow to make a left Join using a Where condition?
I have two tables: category -------- id | nome | imagem user_follow_category -------------------- id | from | to | date Note: the relationship of the two tables is given by category.id and by…
-
5
votes1
answer1427
viewsPerformance of the Eloquent of the Laravel relationship
I realize that in the Laravel 4 Framework, when we have a relationship, rather than using a JOIN of Mysql in the source code of Eloquent, he uses a select. For example. I have these two models.…
-
5
votes1
answer209
viewsGet Rows that are not from the logged-in user
I have a table with columns para and de where I enter different Ids in each one, but I need to get the ID of the user who SENT the request to me, ie the ID that is not the same as the logged in…
-
5
votes1
answer1187
viewsError in PDO query
I am creating a registration page where I have several tabs, as the structure below: <div> Aba 1 </div> <div> Aba 2 </div> <div> Aba 3 </div> <div> Aba 4…
-
5
votes1
answer1174
viewsCopying table in Mysql
Need to make a copy of a table in Mysql for a simulation, is there any function for it? How could I do that?
-
5
votes4
answers2045
viewsHow to limit PHP words
Hello, I would like to know how I limit the text I pull from the database. For example, I have a text called: Lorem ipsum dolor sit Amet. And I wanted you to limit the text by pulling, I’d be like,:…
-
5
votes3
answers280
viewsHow to compare data with accents in the database?
I’m having a problem with a search I did where the user filter content by district and county, is working well when I choose district and county without accents but when I choose a district and a…
-
5
votes2
answers2330
viewsRegistration lock
How could I lockar a record in Mysql? For example, I have a record that is being accessed by the user 000, and I want to lock this record so that users other than 000 cannot access it. That is…
-
5
votes1
answer2036
viewsWhat type should I use to save only the time (no date) in a database?
I am in doubt which type I should use to work with hours on my system. I should use DateTime, Time or TimeStamp. I would like the hours to be saved in this format: HH:MM…
-
5
votes1
answer9051
viewsWhat are the SQL Server Express and Mysql limits?
What are the limits of SQL Server Express and Mysql? How many bases are possible? What is the size of each database? The size of the index files?
-
5
votes1
answer1201
viewsProblem connecting multiple Codeigniter databases
I have an application where it connects to multiple databases, initially I use the file database settings database php.. Only when I connect to another bank, it still loads the file settings…
-
5
votes1
answer609
viewsIs there a parameter passage in a Rigger?
I have two tables, one with the sessions and the other with the activities. Within the table activities I have two fields, available and saleable and within session I have vacancies. I would like to…
-
5
votes2
answers3753
viewsCheck if the login exists in jQuery before submitting the form
I need to develop a system in which when filling the customer’s registration, is verified if the registered email already exists in the database, and if it already exists, that informs the user (via…