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
-
1
votes1
answer205
viewsDuplicate record in the database
Good evening folks. I am in need of a help to remove some duplicate table records from my Mysql 5.7 database By running the following query I can identify which records are duplicated: SELECT…
-
1
votes1
answer252
viewsQuery mysql add day value to previous days
I have the following query: SELECT * FROM vw_total_diario WHERE pessoa ='Daniel' GROUP BY data; It returns as follows: 2017-05-02 Daniel 6 2017-05-03 Daniel 2 2017-05-04 Daniel 8 2017-05-05 Daniel 1…
mysqlasked 7 years, 6 months ago Chefe Druida 1,086 -
1
votes1
answer105
viewsupdate mysql attribute according to a day (12/12/2019) cakephp, mysql
I have the following problem: If a client does not pay a certain portion, he would like the system (mysql+cakephp) to place the client with the debtor status. would have some way to automate this,…
-
1
votes4
answers66
viewsHelp with PHP and Mysql
I have 2 tables; [links] id link clicks Exemplo de Link cadastrado ID link clicks 1 http://www.google.com NULL 2 http://www.gmail.com NULL [users] id nome email Exemplo de user cadastrado ID NOME…
-
1
votes1
answer56
viewsWhat’s wrong with this query?
I have a Dbupdate function that updates the data in the database. This function creates a query based on the array passed as parameter. For example, if I send this array (like $visit) 'ips' =>…
-
1
votes2
answers245
viewsI cannot declare a cursor in Mysql
I have to do a survey of how cursors work to present in college, in all videos I see on youtube people declare this way : declare cur _nome cursor for select a.* from computador as a; but for some…
-
1
votes1
answer22
views -
1
votes1
answer38
viewsError while trying to recover Mysql data with PHP
I’m making a web page that contains login for an administrative area, but where I’m creating and testing (on a local server) is working normally. When I copy the project and put it on my laptop to…
-
1
votes2
answers51
viewsFind out if people did not attend
I have a table called lockers that record the locker number , name of the owner , and I have another table that record the entrance of students, but if someone who has closet missing for 10 days I…
mysqlasked 5 years, 2 months ago Leonardo Silveira 34 -
1
votes2
answers100
viewsRemaining minutes between field and dateAtual
I am trying to create a direct query in mysql where I must return some value if the time interval of the current date and my datareg field is 02 minutes. SELECT * FROM tabelax WHERE grade = 19 AND…
-
1
votes1
answer117
viewsJava database insertion problem
I’m trying to make an app of a veterinary clinic and followed all the steps right to create the database, connect with the eclipse and etc. The program connects, but does not insert anything that…
-
1
votes1
answer163
viewsUpdating Mysql Table at a Certain Time
Good afternoon, My question is the following, I have locks in my application in PHP with Codeingniter, and I need to release users a few times. So, I select my user for 2(Supervisor) but I want that…
-
1
votes2
answers141
viewsVariable receiving only 1 single fetch value, how to fix?
I need to pass all values of the column to a variable, for example: Key -> $key; Content -> $Content; So I used bindColumn, but at the time that fetch() is performing it is only bringing 1…
-
1
votes0
answers40
viewsDoubt in the order of the fields of the table in case of foreign keys with less importance hierarchically
Hello dear programmers! I’m just a beginner in the world of programming and Stackoverflow and need to ask a question! I’m making some adjustments in a database I’m working on after finding great…
-
1
votes2
answers368
viewsCustomers who bought in one year but not another
I need to make a select that brings me which customers bought in 2016 and did not buy in 2017 and vice versa. This is my select: SELECT tc.`cod-emitente` AS CODIGO, tc.`nome-emit` AS CLIENTE,…
-
1
votes0
answers29
viewsHow to insert data into another database table only if it does not exist?
I would like it if, by inserting it in the Customers table in the bank 1, it were inserted in the Customers table in the bank 2, but only if there is no more. Currently my code is like this:…
mysqlasked 5 years, 1 month ago Weslley Fillipe 161 -
1
votes1
answer119
viewsList each user’s last message
Does anyone know how I could list each user’s last message? I was able to do that, but it lists the last message from just one user, and I wanted it to list everyone who sent a message to the user…
-
1
votes1
answer563
viewsRescue HTML text from Mysql database with EJS (Node.js)
I am developing a news portal in Node.js where I save the posts in a Mysql database. As a template engine, I use the EJS. Use the Tinymce plugin to format the text of posts (use bold, Italic and…
-
1
votes0
answers70
viewsCheck empty mysql column
I’m having trouble checking which columns are empty on mysql. I’m using the COALESCE but it only checks the first column of the sequence: COALESCE(column1, column2, column3...) AS values If column1…
-
1
votes3
answers211
viewsDelete duplicate records via php in mysql
Good morning guys, I read some articles here with similar problems, but none of them answered my question, what I want. Here’s the thing: I have a query to check which lines have a duplicate field…
-
1
votes0
answers30
viewsSearch range of numbers in Mysql
Good afternoon. In the customer’s ERP, in the footwear register the grid information is brought in string format, for example "27 to 40". This information goes to the site mysql via an automatic…
-
1
votes1
answer119
viewsPHP - Lumen: update returns true but does not update the data in the database
I’m a beginner in PHP - Lumen and I’m doing my first api. All my methods in the controller are working, except the update. Even if it returns true, the data is not changed in the database. public…
-
1
votes0
answers282
viewsError: SQLSTATE[HY000] [2002] No connection can be made because the target computer actively refused them
I am trying to access through my pc a linux server where phpmyadmin has been installed. What settings I need to make on the server side to get in. I’ve tried setting the door and it’s still not…
-
1
votes1
answer75
viewsMake a START TRANSACTION does not reserve the ID of the tables involved, in case of Insert failure
Hello fellow developers, I put together a script transaction to insert values into 2 different tables, or die at the end of each INSERT, so that the insertion of data does not occur in the second…
-
1
votes0
answers25
viewsStop PHP foreach loop after start
How to interrupt a foreach PHP based on a condition coming from the database after starting the loop? $smtm = Connect::getInstance()->query("SELECT * FROM table WHERE num IS NULL"); foreach…
-
1
votes0
answers22
viewsHow to identify queries that do not use Dexes?
After a long time I decided to check the state of the database, even with everything working normal. I used the mysqltuner.pl to verify. At one point there is the following information: [!!] Joins…
-
1
votes1
answer34
viewsDate format in Laravel
I’m using Mysql as a database for a project developed with Laravel. However, I need to convert the default date format (YYYY-MM-DD) to the "DD-MM-YYY" format. How can I make this conversion?
-
1
votes1
answer1217
viewsinsert data from an array into the database - java
I am creating a system that at a certain point should create an order and this request has several items that I put inside an arrayList. I have an order table in the database, in which way I will…
-
1
votes1
answer56
viewsHow to run a Query in Azure?
I have a PHP SOAP type Webservice on Azure and I am using Mysql in App. The bank is logging in and running...but I can’t run a simple Query! Where is the error? <?php $connectstr_dbhost = '';…
-
1
votes2
answers105
viewsGrouping the largest ID per line does not take up correct values
I have the following table: Tabela: tabela_1 id | id_pessoas | id_empreitadas ----------------------------------- 4357 | 3776 | 37 3949 | 3776 | 3 I have the appointment: SELECT id_pessoas , MAX(id)…
mysqlasked 5 years ago Mario Cordeiro 19 -
1
votes1
answer71
viewsRelationship between four tables
Good afternoon, you guys. I changed the diagram of a bank I had and now I need a help to make a select correctly. I have four tables, where: 1 - Faculty 2 - Training courses 3 - Coordinator 4 -…
mysqlasked 7 years, 5 months ago Elton Costa 13 -
1
votes0
answers55
viewsSubtract sum of two columns
I have a table with this structure: ...| tipo | quantidade E 20 S 15 E 500 the column tipo can be "And", incoming, and "S" exit. and the quantidade is a number. How can I make a select add all type…
-
1
votes0
answers1256
viewsSQL Error [1064] [42000]: You have an error in your SQL syntax
When I add a new row to the table I can delete using the command: DELETE FROM ebdb.tb_categoria as tc WHERE id = 790; However, the lines that already exist cannot delete and returns the error: check…
-
1
votes2
answers353
viewsCharset utf8 on the Datatable server-side
I’m using the Server-side do DataTable to load my table. The problem is that it’s giving problems in the accents. How do I make that connection server-site either using utf8? $sql_details = array(…
-
1
votes1
answer44
viewsDoubt in Select
I have mysql database with some registered information and I need to search through a select Championship and Modalities that a person has no link, but I have tried several ways and I could not…
-
1
votes2
answers560
viewsaccentuation problem when saved in the database
There’s a problem with me, when I save a value in the database, it saves without accentuation. All my code on the page is utf8, all my database is utf8, the tables are utf8 and where does the Insert…
-
1
votes1
answer450
viewsSave visit cookie to page
Hello I am using a mysql php code that counts the visits of each page, but whenever the page is updated it adds one more visit, I would like a help with my code so that it saves the cookie for a…
-
1
votes0
answers472
viewsmysql consuming all ram memory
I have AWS EC2 m3.xlarge with 32GB of memory and mysql is the only application running, and it consumes all instant memory in 8hours version: 5.7.28-0ubuntu0.18.04.4-log The question is how to…
mysqlasked 4 years, 11 months ago Alexandre Belo 11 -
1
votes2
answers235
viewsHow to do a search in MYSQL considering plural and singular
I have a recipes site with a simple search system. But there are recipes that are plural and recipes in singular, for example: chocolate biscuit and chocolate biscuit When someone looks for a…
-
1
votes3
answers3142
viewsSelect Sum in table with PHP/Mysql
I have a table with the following fields: date, time and quantity. And I need to make a select sum of it. To better understand, I have a form where I insert a date, after I insert, I will make a…
-
1
votes0
answers44
viewsSet value of another table in the column of the current table (search value by ID)
I’ll get right to the point. My sql table looks like this: id, venda_id, produto_id, qtd_saida, preco_produto I’d like to fill in the column preco_produto automatically when the product be saved.…
-
1
votes1
answer196
viewsIs using specific data types like SMALLINT and MEDIUMINT instead of INT and marking columns with UNSIGNED an exaggeration?
Speaking of databases, we know that they have several data types to be used in each specific situation. But, following the data types to the letter can be considered an exaggeration in most cases or…
-
1
votes2
answers3280
viewsConfigure Mysql Workbench on Docker
I want to set up my Workbench so that you can connect to the mysql that is running on my Docker server, but when I try to test the connection, I always get the following error: I created my Mysql…
-
1
votes0
answers137
viewsMore than one query in a very slow request in the first C#request
I have a method that requests data from the database and in this same method I call another method that also requests the database (mysql). public class Viagem { public int idViagem { get; set; }…
-
1
votes1
answer104
viewsSelect Feed with another Select Mysql
I’m trying to feed a Select according to what was selected in another Select leading <select id="grupo" name="grupo" > <option>Selecionar Grupo</option> <?php…
-
1
votes1
answer37
viewsDoubt Select in Mysql
I have two city tables and people City has the columns Id/idPrefeito/idVice/nome And people Id/nome... Idmayor and Vice are Foreign Key’s people.id How do I carry in the same select the name of the…
-
1
votes1
answer782
viewsData overlapping on the x-axis of the graph
I need to place a series of dates (timestamp) that are stored in a bd on the x-axis of a graph, the problem is that the dates overlap and it is impossible to perform an efficient analysis. It…
-
1
votes1
answer277
viewsHow do I save an array of quantities and sizes for a product? PHP
I have a crud where I register the product, within this register I have a modal where it is possible to inform the sizes and quantities related to the product I am registering, after this modal…
-
1
votes1
answer79
viewsWhat does a foreign key actually do in the database?
The foreign key in Mysql does some action in the database, or just serves for me to "see" which fields are related there is an auxiliary table? How do I make a foreign key in Mysql?
-
1
votes3
answers60
viewsCopy row to identical table - mysql
Well, I have 2 identical tables in the mysql database, where I registered photos in one, and forgot the other. How do I copy the data from the field foto of TABLE 1 for TABLE 2. But only in that…
mysqlasked 4 years, 10 months ago user175046