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
-
3
votes2
answers334
viewsPerform a DELETE with Where being the result of a SELECT (MYSQL)
Guys, have a code in which I use the result of a SELECT to be a condition in the WHERE of a DELETE. I’ll leave the code part to see if you can spot any errors. UPDATE (which is at the top of the…
-
3
votes1
answer126
viewsPerformance according to box control modeling
I am making a system for daily box control, which allows launches/deletion of values. Below is the table that will store the values, filled with some data to exemplify. There are more fields, but…
-
3
votes2
answers245
viewsDoubts in the modeling of the Database
Guys, I have the Product, Ingredient and Sale table. The product contains several ingredients, e.g.: Suppose that the product is a mixture, it contains 1 bread and 2 Ingredient cheeses, this…
-
3
votes1
answer486
viewsIs it worth encrypting database?
Recently I’ve been having the curiosity about the utility of encrypting all fields of all tables in a database. The idea is this: Create two Crets (one in the bank and one in the application); The…
-
3
votes2
answers86
viewsError saving BD change in C#
I have a certain error when making changes to some data registered in the database, picture below the error also follows the code used: private void btnSalvar_Click(object sender, EventArgs e) {…
-
3
votes1
answer490
viewsGenerate JSON with header and detail of multiple records
I have the following tables: orcamento storing information under the heading of the budget; orcamentoItens that stores budget items; itens that stores the details of the items. (I’ll put the…
-
3
votes2
answers299
viewsError calling PROCEDURE in SQL Fiddle
When making a call PROCEDURE in SQL Fiddle, the following error is displayed: DDL and DML statements are not allowed in the query panel for Mysql; only SELECT statements are allowed. Put DDL and DML…
-
3
votes0
answers64
viewsDatabase for Resumes
Good afternoon, I’m doing my TCC project for a HR system, only I have a question while storing resumes. In which there will be a form where the user registers his information, and if you want to add…
-
3
votes1
answer57
viewsHow to do a column search scan with counter bar character
I am trying to perform a query in a table similar to the one below through a field diretorio. +----------+---------------+----------------------------------------+ |id_imagem | data_upload |…
-
3
votes1
answer96
viewsQuestion with SELECT instruction from a self-relative table
Hello dev’s I own the following table courses(self relational): desc cursos; +-----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra |…
-
3
votes1
answer106
viewsMysql - Phpmyadmin error running Trigger
Hello, when I try to run the following Rigger, I get this error: #1064 - You have a syntax error in your SQL next to line 11 Follow the Trigger: CREATE TRIGGER atualizacao after update ON cliente…
-
3
votes0
answers264
viewsRemove HTML tags with regexp in query
I am trying to query Mysql 5.7 using regexp to ignore HTML tags, so far I have the following query: SELECT * FROM question WHERE question.enunciation REGEXP '[^<|</]center[^\>]' = true…
-
3
votes1
answer214
viewsChecking crashed tables in Mysql with PHP
Here in the company there is a structure with at least 20 servers, each server has at least 20 databases, and each database must have between 40 to 50 tables. For such a structure, rotate the…
-
3
votes3
answers216
viewsAs a search for any term removing spaces, traces and points with LIKE
I’m having a hard time changing a search that I have today by searching a code that has, for example this mask A 901.325.0744 the search is correct because the code is registered in this way and the…
-
3
votes0
answers88
viewsC# EF Core - simultaneous conflict with Trigger mariadb
I’m using EF Core with mariadb, in the database I have fields with defined default values and a trigger "before insert". In fluent mapping, I report the default values to the field normally.…
-
3
votes2
answers138
viewsDelete Full user
Good morning, I’m trying to delete the items from a list but without success. Listing.php <html> <head> <link rel="stylesheet" href="/assets/_css/menu.css"/> <meta…
-
3
votes2
answers48
viewsInsert WHERE into query giving error
I have this query here that is pulling right. However, now I want to put those who have the registration only within the current month (for example September). My created_at is datetime. I’m…
-
3
votes1
answer66
viewsIntervals between two date columns
The problem is this, I have a table that stores the leave (maternity, health, etc...) of an employee, containing the dates of start and end of leave and other information that is not relevant to the…
-
3
votes2
answers299
viewsDo I need to open a Mysql connection for each PHP query?
I need to get several variables based on my bank to mount a full Dashboard. For example, I need the number of lines, the average value of a given field and the same average value only per FU. The…
-
3
votes1
answer36
viewsQuery to find duplicate by DATETIME (MYSQL)
Good morning to all. I need help to better understand how to apply a query that I’m developing. I would need to formulate a SELECT to seek certain records within a period involved (DATETIME). On DB:…
-
3
votes2
answers261
viewsPython Mysql Connector 2 cursor
I just started with python and I’m trying that: import mysql.connector mydb = mysql.connector.connect( infos.. ) cursor = mydb.cursor(buffered=True) cursor2 = mydb.cursor() query = ("SELECT * FROM…
-
3
votes2
answers421
viewsWhat is the default sorting (order) of the result of an SQL query?
Suppose I have a table called "student" in the database, and its columns are nome, matricula and curso, your primary key being the column matricula. The column matricula does not have auto_increment…
-
3
votes1
answer66
viewsRollback does not work
So guys I have a transaction to persist various data on different tables in my database, if by some chance a record goes wrong I need it from a rollback, after all I depend on the return id of one…
-
3
votes1
answer77
viewsDelete records in 2 tables with only 1 DELETE command
Model of the structure of the tables: Tabela: Produtos id_produto titulo_produto descricao_produto Tabela: Fotos id_foto descricao_foto id_produto We can observe that the tables have in common the…
-
3
votes1
answer50
viewsDifference between conventional SELECT and INNER JOIN
Model of the structure of the tables: Tabela: Bancos Cod Nome Tabela: OperacoesBanco Cod CodBanco ValorOp Historico Well I have these two models of SELECT: Example 1 SELECT b.Nome, o.ValorOp,…
-
3
votes3
answers87
viewsQuantity return error in deleting the registration of a sale in PHP code
I’m having trouble with my code that excludes a record of a sale and that must make the replenishment of the quantity of products in the table of origin. Example of how this code works: On the table…
-
3
votes1
answer66
viewsQuery two tables and display the quantity of the group that has the most foreign key records
I need to make a query between the following two tables: Table Class: id_turma classmate class code 1 1A 20201AVesperto 2 2A 20202AVespertino 3 3A 20203AVespertino 4 4A 20204AVsmarter 5 5A…
-
3
votes1
answer68
viewsPrevent the insertion by the user of the same number of CPF in three different fields
In a table I carry the number of patient, doctor and attendant. I’m trying to stop the person from scheduling the 3 with the same values. Like: INSERT INTO agenda(cpf_atendente, cpf_paciente,…
-
2
votes1
answer644
viewsHow can I insert the results of a query into another table?
I am executing the following database query directly from the phpMyAdmin: SELECT shop.id AS cart_details_id, shop.id AS cart_id, e.name AS client_name, e.nif AS client_tin, e.addr AS client_address,…
-
2
votes2
answers210
viewsHow to change a query so that it is executed for each row of table X?
I have the following query of the working database: SET @orderid := '1'; INSERT INTO `cart_lines` ( `line_id` , `cart_id` , `book_id` , `book_reference` , `book_name` , `book_type` , `unit_price` ,…
-
2
votes1
answer341
viewsHow to import Mysql dumps into UTF-8?
I’m trying to import a dump Mysql (in UTF-8), generated in Windows by Navicat, on a server Centos 6.5 with Mysql 5.5. The problem generated with this is... by executing the following command: mysql…
-
2
votes4
answers3156
viewsHow do I create an sql view with more than two tables?
How to create a view sql, I need to get the name and password in the Magento comic that are in different tables, to authenticate in Moodle.
-
2
votes4
answers1443
viewsSQL query that meets a parameter that is a set
I have the following situation: in a MEDICAL CONSULTATION I may have one or more SYMPTOMS. Then I have a CONSULTA_SINTOMA table, making the link between CONSULTATION and SYMPTOM. A disease can be…
-
2
votes3
answers856
viewsQuery search for value in Database
I want to show the results obtained in a form but when saving in the comic null but kept so: Date: 0000-00-00 And Numero: 0 Query have so: $sql = mysql_query ("Select *, Count(*) from tabela1,…
-
2
votes2
answers319
viewsWhat should Query be to get a tuple result where the value of a column is 'x'?
I have the following query: $select = "SELECT concat(mid(cpf,1,3),'.',mid(cpf,4,3),'.',mid(cpf,7,3),'-',mid(cpf,10,2)) as cpf, nome, genero, nome_cracha, rg, crm, crm_uf, rua, bairro, cep, cidade,…
-
2
votes1
answer2336
viewsType of relations 1:1
'Cause when I was gonna remake the relationships in my table 1:1 1:1 -------- 1.1____ (With the dash in the middle but the straight line) What’s the difference between us?…
-
2
votes1
answer5101
viewsLogin with Java Mysql levels
I’m making a login system, only I’m doubtful how I can leave it with levels/ types (admin, user, client). IMPORTANT : I’m making a method that uses Taglib - "C:if", to make a Switch Case. The idea…
-
2
votes1
answer307
viewsUPDATE and SELECT at the same time (locked)
Monitoring the database (Mysql) through Monyog I realize that when some very large query is executed (SELECT) and, at the same time, an update query also runs, under the same table, the update is…
-
2
votes2
answers898
viewsTime Comparison Problem with mysql
I have a problem: I have a table of delivery periods with times for each period Ex.: Das 14:00 às 22:30 the delivery time is 40min. I can get it with a SELECT using BETWEEN. When you arrive at a…
-
2
votes1
answer1510
viewsHow to do multiple simultaneous inserts with php
I need to go through a json and take the values and insert into the bank but I think it would be a bad idea to put an Insert inside a loop. I would like to know how to do several simultaneous php…
-
2
votes3
answers941
viewsIs it possible to convert several tables from Myisam to Innodb at the same time?
Need to convert multiple tables created with Myisam engine to Innodb engine. There are about 250 tables and I wonder if it is possible to convert all of them at once by mysql command line or by…
mysqlasked 10 years, 9 months ago AlbertoReis 21 -
2
votes5
answers7780
viewsHow to use str_replace in single quotes without removing the ones that are required?
I’m going through a database of a friend who had some data entered wrong or a little confused or I’m the one who’s making it difficult. Ex: Mariana "Gurizinha’s" This example was saved in the bank…
-
2
votes1
answer512
viewsClose a Mysql connection without committing or rollback to c# Asp.net
I would like to know what happens in the following scenario: In a program Asp.net with c# was opened a MySqlConnection, soon after a MySqlTransaction, was held a insert in the open transaction,…
-
2
votes1
answer193
viewsHow to check if a transaction was started in Zend
I have a method where a BEGIN TRANSACTION in Zend 1.12. As it is used in many places, it has occurred that a method that calls it already starts a BEGIN TRANSACTION, thus generating a Exception. I…
-
2
votes1
answer5300
viewsQuery server problem has Gone away
An error occurred to me in the Query part mysql_query(): MySQL server has gone away What kind of mistake is this? Query: $sqlinsert = "INSERT INTO tb_trabalhador…
-
2
votes4
answers2192
viewsHow to insert a string containing the *character in the mysql database
I am using PHP and Mysql and am trying to add a NEXTEL and CLARO radio ID field: 23*4567 But when I check what was entered, I see that only recorded what was before *, so: 23 Using a normal query…
-
2
votes2
answers151
viewsSyntax error in query
I am running the following php code: require_once "config.php"; $pagina = $_POST['pagina']; $conteudo = $_POST['edit']; //mysql_query("DELETE FROM $pagina WHERE 1") or die("alguma coisa deu…
-
2
votes3
answers81
viewsOrder of posts when consulting the database of my CMS
I am developing a Site with CMS. Everything works perfectly just that I would like the latest posts to be at the top of the page. What’s happening now is that the last posts go to the bottom of the…
-
2
votes5
answers491
viewsProduct search by name and brand
I have two tables, one call brands with product brands and another call products. Within that table products has shirts, pants and etc. I want that when making a search, for example "Hollister…
-
2
votes4
answers24621
viewsProgram to manage Mysql database on Windows?
Can anyone tell me any program to manage database mysql on Windows? On Mac I use a call Sequel Pro, but it is only for Mac. Does anyone know anything like?…