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
answer30
viewsDoubt in the relations of the Eloquent - Laravel 5:2
Good afternoon sorry if I missed any similar question, I searched extensively both here and in English and found nothing like it, I have the following Model in the database contract id due_date…
-
1
votes1
answer42
viewsHelp with Web Form Update
I am developing a CRUD system, and am having problems updating registered users. The bad thing is that my browser shows no errors. The problem is that when I edit in some field, for example, email,…
-
1
votes2
answers141
viewsError duplicating HTML form in Mysql PHP Data Search
I have the following problem I want to do a search in my database and display the results in the list lines, only it is giving a crazy error, it re-displays the entire page three times, gets like…
-
1
votes1
answer260
viewsHow to turn v-on:click="Sync" into an automatic trigger when opening html
Explanation of the problem Have this javascript in html I call v-on:click="sync" it updates the news list, but this news list until I click Sync it goes blank, so I’m looking for a way to make the…
-
1
votes0
answers39
viewsMysql database insertion problem in php
I am developing a project for the college and I am having some problems to perform the insertion in the my_sql database, my problem is in this excerpt. mysqli_query($conn, "INSERT INTO funcionario(…
-
1
votes1
answer118
viewsHow to recover php parameters passed by the $http({ ... data: ...?
I have my controller that requests login: app.factory('LoginService', function($http, $location, SessionService) { return { login: function(data, scope) { $http({ method: 'GET', url:…
-
1
votes2
answers1807
viewsINNER JOIN with equal fields in a table - Error: #1066 - Not Unique table/alias: 'tb_usuario'
I have 3 tables as follows: At tb_usuario, I have two types of users (buyer, seller) in an ENUM field to differentiate the type of user. In the shopping cart I have the user Ids, product and…
-
1
votes0
answers46
viewsTurn a multi-line query into One Line Only with all records in MYSQL
Someone with knowledge in MYSQL to help me in this case? How to turn a query that generates multiple lines into a single line with all records next to each other in the Mysql database. Example in…
mysqlasked 6 years, 5 months ago Jorgito da Silva Paiva 177 -
1
votes1
answer441
viewsProcedure to create database and tables
I need to create a data bank for each client that makes a certain registration, for this I created a procedure to do such a thing. But I came across a small identification problem. When I run the…
-
1
votes1
answer224
viewsI wish to make a Stock Control Rigger, but do not know how to do it
I want to create a table called 'product' that has your id and quantity in stock and another table called 'purchase', the purchase table will have the primary key of the product and the purchase id,…
mysqlasked 6 years, 5 months ago Nathan Silva 87 -
1
votes0
answers27
viewsPHP - Undefined Index on line 18 login system
<?php if($_POST){ $nome = $_POST['nome']; $pass = $_POST['pass']; require_once 'connect.php'; $cons = "SELECT * FROM usuario;"; $execute =…
-
1
votes1
answer373
viewsProblem with referential integrity in Migrations (Laravel 5)
I’m having a problem using onDelete('set null') in a foreign key. You are returning the error: [Illuminate Database Queryexception] SQLSTATE[HY000]: General error: 1215 Cannot add Foreign key…
-
1
votes1
answer146
viewsHow do I recover the current date of a Mysql database in Arduino?
I’m making database connection mysql using the Arduino next to esp8266, wanted to know how to take current date store in a variable to then send to the bank. I’m in trouble just to get the current…
-
1
votes3
answers1926
viewsHow to put a php variable in a mysql query?
For example: $query = "INSERT INTO tabela (data, assunto, destino, elaborado) VALUES('{$data}', '{$assunto}', '{$destino}', '{$elaborado}')"; Where is tabela, i want to put a variable in place,…
-
1
votes1
answer131
viewsQuery string works in Phpmyadmin and does not work in PHP
I have the following query that picks up a date, was tested on phpmyadmin and the Heidisql program successfully: Query Mysql set @rn:=0,@grp:=0,@prevdate:=''; from (select DataEncomenda, @rn:=@rn+1…
-
1
votes1
answer67
viewsCONCAT not working
SELECT indicativo_ja_registrado, qra, fez_contato, DATE_FORMAT(data_qso, '%d/%m/%y') AS data_qso, DATE_FORMAT(data_agora, '%d/%m/%Y') AS data_agora, TIMESTAMPDIFF(YEAR, data_qso, data_agora) AS…
-
1
votes0
answers49
viewsPass variable into the IN
I’m having a hard time passing a variable into the IN in Mysql - PHP - PDO. The URL looks like this: /PESO=50&IDADE=18,20 Code: $read->FullRead("SELECT DISTINCT NOME FROM pessoas WHERE PESO…
-
1
votes1
answer213
viewsGet elements from one dependent column of another
I have to make a table where indicate the "name2", "local" and "name" of the animals in greater number in each "name". SELECT DISTINCT OP.nome , OP.localizacao , AD.nome_cientifico FROM C AD , A OP,…
-
1
votes1
answer31
viewsSum null value Laravel
I am trying to sum the following with Query Builder, but if one of the values is null and does not sum DB::raw("estudantes_carga_horaria.dias_letivos_oferecidos +…
-
1
votes2
answers145
viewsIs it possible in Mysql to update column information in several duplicated rows, leaving only one row with the original value?
For example, I have several rows in a table (which I pulled from an XML of google products, so the same product is presented several times, each for a size of clothing/product) which are referenced…
-
1
votes1
answer401
views -
1
votes3
answers200
viewsSelect bringing maximum Columns with Writing - MYSQL
Guys, I have the following structure in a Mysql table: https://prnt.sc/k0d0ev I need to make a select that brings me as many posts as there are any records, for example, in reference 269 bring me to…
-
1
votes1
answer219
viewsmysql Rank function grouped for a COUNT
I have 3 tables in MYSQL represented here as an example: I need a query that returns a RANK of contracts made grouped by commercial in a given period of time, for example: A query that returns the…
-
1
votes3
answers1286
viewsWhich is faster: NULL or NOT NULL (with an empty string)?
I have a table with fields NOT NULL and they end up being empty. What’s the difference between a NULL (allows null values) and NOT NULL with an empty string ('') within?…
-
1
votes1
answer29
viewsSum of two tables and display of results
I’m having problems with this section and I can’t solve " mysqli_fetch_array() expects Parameter 1 to be mysqli_result", $Valor = mysqli_query($conexao,"SELECT SUM(Y) AS TotalY AND SUM(X) AS TotalX…
-
1
votes2
answers309
viewsSelect in two tables with data from the first table?
In a table that contains some comments, one of the columns stores the ID of the user who made this comment, how can I recover the data of that user with the ID at the time of making a query in the…
-
1
votes1
answer38
viewsCreate a query by checking two columns
I have a following table: tbl_mission id_misssao assignment status id_warrior id_creator When the user creates a mission, he can add this mission to himself or he can indicate another user (warrior)…
-
1
votes1
answer679
viewsInsert result ajax dynamic query into input
I am using a dynamic query co AJAX + JQUERY, the result is appearing below as shown in the image above. <div class="form-group"> <label for="inputEmail" class="col-lg-4…
-
1
votes2
answers754
viewsHow to insert multiple records with 1 Insert?
I need to enter multiple records with an Insert Example: $ids= "1,2,3,4" $conn->prepare("INSERT INTO documento (id) VALUES (1)"); $conn->prepare("INSERT INTO documento (id) VALUES (2)");…
-
1
votes1
answer127
viewsProblem presenting date in Qtablewidget in python with Pyqt5
I have a program that shows product information and I wanted to present the date, only when the date comes up, this is what it shows: PyQt5.QtCore.QDate(2018, 7, 7). For those who need the code…
-
1
votes2
answers138
viewsgroup columns in mysql
Have these Insert in the table I would like an sql me returns the total points of the type team: time - points Uruguai - 9 Russia - 6 Rabia - 3 Gito - 0…
-
1
votes1
answer143
viewsSelect with subquery
I have the following select: SELECT id_usuario, SUM(CASE p.tp_honorario WHEN 'Mensal' THEN (h.vl_honorario * 12) ELSE h.vl_honorario END) as valor FROM empresa_honorario as h INNER JOIN honorario as…
-
1
votes0
answers133
viewsHeavier queries in MYSQL
How to know which queries are being heavier in my mysql bd? Have some command I can give that will bring me this data?
-
1
votes1
answer300
viewsAndroid - String and varchar comparison
I’m having trouble comparing strings. A retreat of a Edittext and the other of an SQL table. The app is a game like "Who wants to be a millionare?" When it comes to the if cycle of comparison…
-
1
votes1
answer181
viewsAdonisjs - Generate code from database already created
I have a question. I’d like to know if it’s possible. I have a Mysql server already running a model of mine, with tables already created and their due fields. Have some way to connect a Node…
-
1
votes1
answer1023
viewsCall to Undefined method PDO::bindParam(), how do I fix it?
I’m starting OO studies and decided to take a look at the PDO, only it’s not working. Help me, please: <?php class Cliente { private $nome; private $email; private $telefone; protected $cpf;…
-
1
votes1
answer692
viewsPercentage calculation in mysql
I have a booking table that has ID, ORIGIN (site, app or null) I want to know the percentage of reservations made by app and website, select count(id) from booking where origin = 'app' / select…
mysqlasked 6 years, 4 months ago Daywison Ferreira Leal 101 -
1
votes3
answers922
viewsHow to create a table (empty) from a selection of other tables?
EXAMPLE: I have two tables : Tabela1 : two-column id_product, product name; table 2 : three-column id_brand, id_product, tag I would like to create a Tabela3 from a selection of the Tabela1 and…
-
1
votes0
answers89
viewsNo column name in jTable
I created a Jscrollpane and in it a jTable, all this inside a Jinternalframe, but when I run my Jframe and open this Jinternalframe, it only shows the data in rows that are in my database, but does…
-
1
votes1
answer141
viewsWarning: Pdostatement::execute(): SQLSTATE[HY093]
Goodnight! I am mounting a CRUD, I took some codes on the Internet and adapted to my need, everything was going perfectly well, but when I got to the UPDATE part the application presents me the…
mysqlasked 7 years, 11 months ago Adriano Moreira 11 -
1
votes3
answers75
viewsConditional for registration selection
am with a question for selecting a record from a table and would like a help. An example of the structure of the following table: idhistorico_professional | idprofessional | funcao | inicio | final…
-
1
votes2
answers165
viewsHow to do a double "Update" in Mysql
I am developing software in PHP/HTML/MYSQL FRONT. I need to update a table but change two columns at once. Here comes my doubt in the $gravaprat1 variable, because it is not executing the second…
-
1
votes1
answer293
viewsHow to count how many fields are empty in the mysql table
I have a land register table with several columns (some of them: id, address, city, proposal, etc) and I would like to count how many fields are empty. For example, the table has a total of 44…
-
1
votes1
answer78
viewsHow to avoid dual Insert with different mysql Primary key
My problem is critical in the system for some reason it inserts 2 times, I have tried to simulate the problem giving several clicks but did not duplicate. In my php code I validate if the record…
-
1
votes1
answer209
viewsHow to rollback a specific table
I have a backup of my entire base of all tables from the following command: mysqldump --default-character-set=latin1 -u root -p[senha] [base] > Z:Backup I wanted to do something like: mysqldump…
mysqlasked 6 years, 4 months ago Marcius Leandro 462 -
1
votes1
answer375
viewsdate + 2 working days
I have a date (fatura.baixaboleto, "%d%m%y") and in this consultation I want to add 2 more working days, example: Day 16/07/18 + 2 working days = 18/07/18 (Monday to Wednesday) Day 19/07/18 + 2…
-
1
votes2
answers104
viewsDoubt in the elaboration of a query in SQL
Could you tell me what’s wrong with this SQL code? I want for each film, the wages of each staff do not appear repeated, that is, if in the first film has 2 leads, in the table I want the sum of…
-
1
votes0
answers364
viewsSQL Select inside a select with condition
I have 3 tables in the database to control a "news portal", where the tables have the following functions: news -> Table with the news gallery -> Table with images used in news relation ->…
-
1
votes0
answers15
viewsHow to reorder the result of a query if it has a specific result?
I have a query (select nome from coisas;) that returns to me for example: escova mesa cadeira garfo How do I make so that if there is a "chair" in the results, it always appears first, and the…
-
1
votes2
answers111
viewsWrite in search field date in dd/mm/YYYY format and search in the database in YYYY-mm-dd format
I want to type in the form the date in the format dd/mm/YYYY but search in the database in the format YYYY-mm-dd, please already tried everything, from a HELP Ai