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
-
0
votes1
answer51
viewsShow in select database results
I’ve researched this before and I could never get a code that works. When I put the code on, nothing gets a single option. I wanted a code that could see the data in a select Code that I’m using:…
-
0
votes1
answer26
viewsHow to Get Data from an N Relationship for N
Eu tenho uma tabela tb_produtos com idproduto, desproduct, outra tabela tb_categorias com idcategory, descategory, e por fim uma ultima tabela product_category com idproduct e idcategory. If I want…
-
0
votes1
answer32
viewsUsed AUTO_INCREMENT to create ID numbers
I am using AUTO_INCREMENT to automatically add an ID whenever I create a new column. However when clearing a column, the ID number continues to add +1 instead of starting from where it left off. How…
-
0
votes1
answer323
viewsSearch for record in another table with mysql and sequelize
How to search the column record nome on the table categoria, for id that was saved in the table postagens? const db = require('./db') const Post = db.sequelize.define('postagens', { titulo: { type:…
-
0
votes1
answer41
viewsCreate mysql user in Trigger
I need that after being registered a new person in the table Trigger be fired and create a new user in the database with the data name and password of the registered record. I tried with several…
-
0
votes2
answers33
viewsConcatenate data from a table
I have the following sql statement: SELECT a.alunonome AS aluno, m.materianome AS disciplina, AVG(CASE n.notabimestre WHEN 1 THEN n.nota ELSE null END) AS bim1, AVG(CASE n.notabimestre WHEN 2 THEN…
-
0
votes1
answer59
views -
0
votes1
answer111
viewsVariable not defined in SQL query for PHP
I am trying to send an array in PHP, a query with the information of a table in Mysql, but I am finding the following error when I try to print an array position: "Notice: Undefined variable: array…
-
0
votes0
answers29
viewsHow to Recover Deleted Lines from MYSQL?
I unintentionally deleted some rows from mysql, because of a LIKE misspelled. There’s a way I can get those lines back? I don’t know if it helps the answer, but the delete command was: DELETE FROM…
-
0
votes1
answer166
viewsProblem when saving date in mysql database with spring
I am trying to save a date in the database using spring + jpa in mysql. In my class I have the following field: @Column(name = "dataNasc") @DateTimeFormat(pattern = "yyyy-MM-dd") @NotNull private…
-
0
votes0
answers32
viewsCreate trigger to delete old Mysql data
Good morning. have a table "data" in this table are saved various information like 'user_id' and 'time'; I would like to create a trigger for when entering a new data delete the older than 90 days.…
-
0
votes1
answer99
viewsReturn of a for in a python list
I would like to use the return of a for that list files from a directory to use in a Mysql command, but I can’t get all the files. thanks in advance for the help! #Lista os arquivos do diretorio…
-
0
votes0
answers153
viewsHow to create a temporary table within a stored procedure
greetings! My question is the following: I would like to know how to create a temporary table within a procedure, in which the values of my temporary table will be taken from a permanent table in my…
-
0
votes0
answers20
viewsIs it possible to use the DATENAME() function with the mysql datetime format?
How are you doing? am here with a question I am creating a website in HTML and PHP and wanted to show some data from mysql database, I have a field that is autoincrement that is datetime and with…
-
0
votes2
answers132
viewsProblems with update in federated table
I have a problem understanding a mistake when using a federated table. Setting: Server A: create view federated_view as SELECT .... Server B: create table table_federated (A, B, C) ENGINE=FEDERATED…
-
0
votes3
answers1087
viewsHow to put default value in time field in mysql?
I searched the web but I did not find anything specific for time field in mysql, only date and timestamp, I am creating a field "hora_emissao" type "time", because I want to store only the time in…
-
0
votes1
answer31
viewsFilter query for mysql dates
have this mysql table: And I have the following appointment: SELECT * FROM tabela WHERE 1 = 1 AND data_prova >= '2020-03-01' AND data_prova <= '2020-03-26' Well, with this select use for a…
-
0
votes1
answer35
viewsMysql, SELECT and JOIN in tables with NULL columns
Folks would like help with my comic. I have three questions to answer and I can answer only the third, as I answer the others? 1) Which carriers are present in only 1 category? 2) Which carriers are…
-
0
votes1
answer23
viewsHelp with job creation agenda query
Galley, I’m making a script to trigger a message according to the record recorded in the database. It’s like a CRON task. I have the following record I will put a PHP page in the CRON task of…
-
0
votes1
answer32
viewsCreate function to change a data in the database table
Good morning, I’m doing a function so I can alter a data in a database table. That is, I have 4 data recorded in my database table where the main is 'yes', when recording a fifth data, the second…
-
0
votes1
answer30
viewsI’m not able to save a data edit with php and mysql
Save working properly <?php include "conectar.php"; $nome="$_POST[nome]"; $sobrenome="$_POST[sobrenome]"; $email="$_POST[email]"; $cpf="$_POST[cpf]"; $dddcel="$_POST[dddcel]"; $cel="$_POST[cel]";…
-
0
votes2
answers288
viewsSum the total value of a given column for each table - Mysql
I have the following query: SELECT FORMAT(valor,2,'de_DE') AS valor, DATE_FORMAT(data_vencimento, '%d/%m/%Y') AS data_vencimento, realizado, DATE_FORMAT(data_realizado, '%d/%m/%Y') AS…
-
0
votes1
answer908
viewsConvert image size before saving to BD
I would like to increase my processing code: // Local onde imagem vai ser salva $_UP['pasta'] = '../../media/'; // Tamanho da imagem $_UP['tamanho'] = 1024*250; // 250Kb // Exrensões permitidas…
-
0
votes1
answer154
viewsSelect return result even if there is no NULL record, grouped by day
I have a select that returns a data set by DATA. Example: As you can see in the image below, there is no data for days: 20,21,22...28 I would like to bring those lines with result "NULLO" My select…
-
0
votes1
answer301
viewsError while deleting with PHP using PDO class and object orientation
I’m making a delete on my form manut_usuario, below is my method to delete which is in class usuario.class.php; public function DelUsu($id){ try{ $delUsu = "DELETE FROM usuario WHERE idu_usujport =…
-
0
votes0
answers278
viewsPDO, Select a query with some fields, from a certain user and code
I need to set up a consultation where I’ll only have five fields (STATUS, ID_USUARIO, PACKED, ID_TRANSACAO and ENTREGUE). I need that when I have change of STATUS change to another table, and update…
-
0
votes1
answer37
viewsHow to make a Bulk update with two primary keys in the stored mysql database?
I need to perform an update several times as follows: UPDATE my_table set column1='value1', column2='value2' where primary_key1=1 and primary_key2=2; UPDATE my_table set column1='value3',…
-
0
votes0
answers181
viewsHow to Update 2 tables with Switch case and database data and others coming from an xml return?
I have progressed a lot in the code, within what I thought was necessary, only I don’t know how to organize my syntax so that everything happens as I want, the switch/case that runs in the bank to…
-
0
votes1
answer18
viewsSelect Join with last Mysql record
Good morning, I’m having trouble doing this search in mysql: I would like to get all active users with their last trips (last registration): Command used: SELECT u.id, t.user_id, u.name, u.status,…
mysqlasked 4 years, 6 months ago Helder Ferrari 75 -
0
votes1
answer102
viewsTo insert a value passed by parameter in the sql query
I am passing two values of an input to the function "Insert", the values then arriving at the function normally, I am printing them to confirm, but still I can not insert the values passed in the…
-
0
votes1
answer505
viewsHow do I query passed by get in id Pdo to code
I’m starting in Pdo now, so will start the games for me a little bit and my question is the following: I am working on another code of a friend and in his code the get to display the information is…
-
0
votes0
answers21
viewsSlow MYSQL query, when searching for date
I’m doing a date search on mysql, but it gets very slow (more than half a second). Is there any way to optimize this search to get faster? Ex: of consultation: SELECT dt.data,count(d.id) AS…
-
0
votes1
answer20
viewsSubtract a day on all dates within 5 months
Good morning, I need to subtract a day from all the data of the bank in the period of 5 months and update the bank with these new values. The query below returns the data already discounted one day:…
mysqlasked 4 years, 6 months ago user33105 -
0
votes0
answers23
viewsChange wp_query on the detail pages of each project according to the selected option on the project page
On the project page, where all the projects are, you have one option(select option) to sort alphabetically and another to sort chronologically. When going to the detail of each project has a link to…
-
0
votes1
answer137
viewsHow to update a different table with data from another table in PDO
I have a pay-as-you-go table, and in it I have an indemnification code for every transaction, when receiving the update data, I want to take the data and enter in update in another table of the…
-
0
votes0
answers76
viewsWhat’s wrong with Foreign key?
I am working out a database, but at the time of generating the diagram in reverse engineering Workbench no table linked with another, and does not appear the FK, I wonder if I did something wrong,…
-
0
votes1
answer30
viewsSQL grouping the same data, but showing the photos of the records
I have an SLQ that returns the amount of repeated records grouped together, However my need is to list all photos from duplicate records SELECT count(Longitude) AS registros, id_local,…
-
0
votes1
answer68
viewsBETWEEN error day 31
Good afternoon, I did some research but I couldn’t find a solution, so I’m asking for help here. My system recovers data released between date ranges using BETWEEN. Using the query to catch the…
-
0
votes4
answers45
viewsHow to pass a text from the database to display it as a link on a website
Hello, I’m making a site in php and html, linked to a database in mysql. And I have a table of news in the database, with the idartigos fields, title, text and link. The link is running in text and…
-
0
votes0
answers95
viewsHow to make profit simulator by clicking on a link
Hello! I am doing a web project and I needed a click simulator, in which for each click on the link simulated give 1 centimo, 0,01 euros (Portuguese currency) The instructions they gave me were:…
-
0
votes1
answer108
viewsGet description of sub-category PHP Laravel Eloquent
Hello, I need to get the description of my parent category, but I can’t get the description in the same select, I can only get the id of the parent category. I have a table with the following…
-
0
votes1
answer402
viewsMysql - Update column with Brazilian date value
I am updating a table in a bank with more than 100 thousand records to be able to perform future SELECTS to generate a statistical report. The table currently has a 'Birth' column of type…
-
0
votes1
answer397
viewsConvert sql to query Builder - Laravel
I’m starting at Laravel and I have doubts about eloquent. Could someone help me convert that code SQL in eloquent? SELECT COUNT(d.id) as total, d.nome_disciplina FROM bd_assuntos as a INNER JOIN…
-
0
votes1
answer3585
viewsConfirm registration by sending email
Hello! I have a registration and email sending code, but I don’t know why, it’s not working... resgistar.php (form of registration) <!-- Form do Registo --> <div class="w3-row-padding…
-
0
votes0
answers52
viewstraffic simultaneo in the classic Asp
Good afternoon, everyone, I’m having a problem in the company recently we need to migrate an application from one server to another to save time we made an image of the server and climbed the new,…
-
0
votes1
answer92
viewsCreate select box with dynamic data
Good morning, I wanted to implement in my project a select box but where the options are the "name" column of another database table, I mean, I am creating an object and it is possible to associate…
-
0
votes0
answers13
viewsI want to search dates in Mysql
I need to search details of a table creating a precedent and using month and year as variables, but I do not know how I could do it, the column dataPedido is defined as Datetimethought about…
-
0
votes2
answers677
viewsQuery sql codeigniter
I have a table with dates and I would like to create a query that returns records with dates prior to the current day but I could not assemble this query; follows below my code and BD image:…
-
0
votes1
answer235
viewsMaximum number of rows of a Mysql import
Well, I am making the import that contains all my databases, because I switched from computer, I exported from old and I want to import to new, but when importing I get an error: "tempo limite…
-
0
votes1
answer25
viewsConcatenate an SQL value
I have a Rigger that updates a certain table of raw material, however it replaces the existing quantity and I need it to concatenate the new value with the existing value, someone could help me how…