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
-
2
votes0
answers552
viewsMysql consuming a lot of memory
My server is set to limit mysql memory usage by 70%, at all times mysql is at 73.8% or even 74%, even when almost no one is using the system gets like this, ai from time to time error in someone…
-
2
votes4
answers134
viewsMysql query involving Profession and Note information registered in the same column
Consider a table with the following structure: the column contract code corresponds to a foreign key from another table. It is a contract code. Each contract has basically 4 records in this table in…
-
2
votes3
answers599
viewsAdjust time in PHP string
My hosting is configured for UTC (GMT 00:00) and I can’t change through Mysql, due to blocks being a shared host. My PHP code brings results of date/time of orders, but it is with 3h above (due to…
-
2
votes1
answer135
viewsHow to close a td with a tr after the loop and continue printing the rest of the code in PHP
all right? I have a small problem taking the data from a database and trying to turn it into a table type, I happen to be looking for the data I need to mount a part of the table in a query and the…
-
2
votes1
answer368
viewsMYSQL Does Not Start
Hello! I previously migrated my database from one directory to another within the server itself (/var/ to /mnt/) for lack of space. Only that when starting the server again, after having changed the…
-
2
votes2
answers127
viewsSearch last access record with MYSQL
Suppose I have the table clientes: -------------------------------------- | ID| Cliente | Data_Registro | |------------------------------------- | 7 | Joaquim | 2019-07-17 09:45:00 |…
-
2
votes1
answer1417
viewsMount SQL query in Python3 from data in a dictionary
I’m trying to format a query and leave it this way: INSERT INTO users('username', 'password') VALUES ('meuusuario', 'minhasenha') But you’re returning me with []: INSERT INTO users(['username',…
-
2
votes1
answer190
viewsConnection Tkinter - Database
Good night! Guys, I’m starting in the world of programming and today I was following a tutorial that for me didn’t work and I don’t know how to solve the problem, I tried everything. This is to…
-
2
votes1
answer289
viewsForeign key with UNIQUE
What happens if I put one foreign key as UNIQUE in a table? I tested that possibility but maybe I misunderstood, if we apply a UNIQUE in a foreign key and insert the wrong value in this table, the…
-
2
votes2
answers103
viewsInsert value in Table Y for all existing Table X Ids
I have a table called CONTAS with a column account_id. I have another table called PREMIO with columns account_id, id_premio and itemqtd I wanted a command where I inserted the id_premio and itemqtd…
-
2
votes1
answer35
viewsProblem to update database record with ajax
Good night, I’m trying to update the database via ajax, but it’s not working,I have two text area, and update it with update. Before trying without ajax, it was working perfectly, only now that you…
-
2
votes2
answers108
viewsHow to perform Submit in a form with input text and two inputs file?
I made a registration form where the user must fill name and CPF , and attach a photo of RG and another selfie. I already created the database on mysql, however the submit doesn’t work. When I…
-
2
votes1
answer59
viewsSelect by schedule time
Good afternoon, Folks! I’m building a TV grid app. There is a table in the database that contains information from (Program name, description and time). In my application, the system sorts this…
-
2
votes1
answer473
viewsHow to count the number of empty columns in MYSQL
I have a MYSQL client registration database. I need to make a query to know the amount of blank columns each record has. For example, in total I have 15 columns (name, email, address, etc) and "So"…
-
2
votes2
answers552
viewsHow to insert a midnight datetime into mysql?
I’m using the Laravel Framework 5.8, I am trying to register a record in the database where I need to set in API some dates. Although they are CURRENT_TIMESTAMP, i also need to be able to enter a…
-
2
votes1
answer58
viewsMysql database coordinate persistence using Entity Framework
I’m having trouble making an efficient select for geolocation coordinates in Mysql. In the bank I am saving two values related to latitude and longitude, so when I perform the Select the two values…
-
2
votes0
answers107
viewsHow to find an image that is stored in the database and display it in an HTML IMG?
So, I am making a page on which the user uploads an image and it is stored in the database (Mysql). See below how it is stored in the bank: So far so good. Now I would like to take this image and…
-
2
votes1
answer72
viewsHow to make a select taking into account if the record exists, if it does not exist return null or empty
I have a code that returns the activities that have been completed within a 12 month period. SELECT empresas, tipo_atividade, CASE WHEN (SUM(CASE WHEN MONTH(dt_vencimento) = 1 THEN 1 ELSE 0 END))…
-
2
votes1
answer86
viewsSELECT returns nothing when I put a WHERE clause
When I run the following sql command I get an empty return, even if I indicate an id that is present in some rows of the table to be searched SELECT e.data_request, e.id_exchange, e.data_exchange,…
-
2
votes2
answers193
viewsHow to make a Select with multiple SUM?
Hello, I have a table of activities that lists activity data, including her status. I would like to sum up the activities of a particular user and display in a graph, showing according to the status…
mysqlasked 5 years ago Gato de Schrödinger 2,367 -
2
votes0
answers62
viewsI can’t run a query with PHP and SQL
good night I’m new to php, and I’m having trouble making the search field work. I’m making a system that has a tutorial page, which has the cards with the tutorial information and a search field. I…
-
2
votes3
answers127
viewsHow to get dates with X days interval?
I have a field data in a table. And every day I will search: SELECT * FROM table WHERE DATE_ADD( data, INTERVAL 7 DAY ) = CURDATE( ) That is, if the date of the table + 7 days is equal to today.…
-
2
votes1
answer255
viewsHow to define an image, coming from the database and stored in binary, as background-image of a div?
I have an image that is stored in the database of binary form. I rescued this image (through a select) and would like to insert it as a background-image of a div. I can only insert it as src of a…
-
2
votes1
answer66
viewsIgnore unfilled Mysql PHP fields
I need to bring information from a table that uses several fields. This information needs to be handled before entering an HTML Select. Every structure for this is already ready using AJAX but I’m…
-
2
votes0
answers49
viewsStored Procedures
I have a Mysql database with several stored procedures, like releasing only one for a particular user? I have a database Mysql with several stored procedures, how to release only one for a specific…
-
2
votes2
answers103
viewsHow to search multiple data in mysql without losing performance
I have a table called "readings" where my search returns 10 thousand results for the equipmentid = 1 SELECT id, result, date FROM readings WHERE equipamentid = 1; for each returned result I need to…
-
2
votes1
answer356
viewsInsert embed video with mysql
Good afternoon, I am developing a website to simplify the search for educational videos for my TCC. I made a system with two combo box to search the disciplines in the database and the contents,…
-
2
votes0
answers126
viewsHow to assign a null value to an input variable if the user leaves the field blank or type zero?
The context in which the problem arose is the following: I have a stored procedure that performs the registration of certain values in a table of my database. In this procedure I set all variables…
-
2
votes1
answer669
viewsProblem to export table in xls format with PHP
Good afternoon. I have a button that generates a file . xls that should bring a spreadsheet from an SQL query... The file is generated, the problem is that a message appears in Excel saying that the…
-
2
votes2
answers122
viewsarray.push() inside mysql.query callback (nodejs)
Hello, I am having a problem adding a custom error in an array of errors, in the validation of a form with nodejs. I’ve tried to change my approach but I haven’t found a solution, //PARTE 1 let…
-
2
votes0
answers69
viewsDoubt mysql SELECT
Guys I’m having a question, follow the SELECT down below: SELECT o.matricula, v.cd_operador, o.hora, c.nm_nome, COALESCE(SUM(o.quantidade), 0) AS sacolax, v.sas03 AS sas03,…
-
2
votes1
answer26
viewsMYSQL queries doing Table Scan even using index key
I started recently to study the performance of the queries in MYSQL, I am trying to use EXPLAIN to go analyzing and improving the indexes of my tables, until I came across the following situation. I…
mysqlasked 4 years, 6 months ago MichellHenrique 89 -
2
votes2
answers149
viewsCondition in PHP "if" to know if the sent Mysql command worked or not
I’d like to know what condition to put inside the if using PHP with Mysql database so it is possible to know if the command returned an error or not. As seen in the code below, I want to delete a…
-
2
votes1
answer405
viewsDo a database search without refreshing the page
I’ve been trying to do a database search for a while, through an input. The idea is in a Model have an input to enter a date and without using a Submit send the date to another Model and then…
-
2
votes2
answers69
viewsset Enum field to null in Procedure
I have a precedent that I receive some data and these may come empty up there all right, but when the field is Enum and I try to set as null gives data truncated error for column even the field can…
-
2
votes2
answers49
viewsQuery to return minimum amount of "different" values
I have a table called clientes and this table has a column status which may have +/- 3 types (novo, cancelado, pendente...) need to display a quantity of information separated by status, and instead…
-
2
votes2
answers109
viewsCONSULT DATA FROM A FOREIGN KEY TABLE
I have 3 tables in a database, one houses customer data, other products and one sales, containing foreign table id key products and customers. I need to make a query that shows the purchases made by…
-
2
votes1
answer42
viewsHow to duplicate a table by changing string values to decimal
Good afternoon, you guys. I am learning SQL and I set out to import a table . csv from the central bank to apply my knowledge. The table consists of four columns: date entered | name of the currency…
-
2
votes0
answers96
views -
2
votes1
answer52
viewsMysql, Sum accumulated values by date and ID
Good afternoon, I’m having a problem to get a relatively common result, I’ve seen some materials talking about but none applied to my specific need. I need the cumulative total of each release,…
-
2
votes1
answer42
viewsARRAY DATABASE
Personal created a form where I will put the quantity of products and send to the database, except that when I click to send is not saved only saved from one to one, someone could help me I’m trying…
-
2
votes0
answers49
viewsLogin Does not work even by putting the right password
The problem in the case is that regardless of whether the password is wrong or right it says the credentials are wrong, and does not log in //php code if (isset($_POST['login'])) { //variaveis que…
-
2
votes1
answer32
viewsCast in MYSQL X Performance
I’m trying to improve my Sqls in Mysql and PHP, in the analysis I ended up coming to a CAST function is increasing by at least 5X the search time as follows below: CUSTOMERS table where the DATACAD…
-
2
votes2
answers131
viewsInsert data with pymysql into a mysql database error. How to resolve?
seqteste.txt or List: >gb:KX262887|Organism:Zika virus|Strain Name:103451|Segment:null|Subtype:Asian|Host:Human GTTGTTGATCTGTGTGAATCAGACTGCGACAGTTCGAGTTTGAAGCGAAAGCTAGCAACAGTATCAACAG…
-
2
votes2
answers36
viewsRelationship between Similar Tables
I have a Relational Database structure. I will illustrate more briefly my tables: Tab_client with fields (ID, Name, ETC...) Tab_company with the fields (ID, Name, ETC...) Image tag with fields (ID,…
-
2
votes1
answer47
views -
2
votes1
answer30
viewsQuery returning users who have a set of records from another table
I developed a small system in PHP and Mysql that aims to store and manage users and their respective courses. I searched some forums and pages in Google, but I did not find any information to help…
-
2
votes1
answer92
viewsWhat is the right way or how to close persistent PDO connections in PHP?
I need to close the connection to the Mysql database in PHP in the code below: try { $conn = new PDO('mysql:host=localhost;dbname=banco', "root", "", array(PDO::ATTR_PERSISTENT => true));…
-
2
votes1
answer71
viewsSearch for similar names or with typo - Mysql
I am looking to perform a search in a table containing the name of the products. I created a FULLTEXT to optimize the performance of the queries. SELECT * FROM tabela WHERE MATCH (campo) AGAINST…
-
2
votes1
answer35
viewsPull image from database
I’m creating a website recipes and wanted to show the image that the user entered when registering. In my database I made two tables, one from the recipe and the other for the image file. CREATE…