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
votes3
answers121
viewsSelect the first result of each conversation
How can I select the first line of each conversation from a specific user where the to_id = 1. The big problem is when the first message exchanged from the conversation does not have the top_id = 1…
-
2
votes1
answer51
viewsHow to ensure that all information was recorded at the bank?
I’ve been realizing that I’m having trouble recording information in the bank because: -I’m running a block of a method that records data in the database: //codigo aqui…
-
2
votes1
answer421
viewsMultiply SELECT value with INPUT value
How I could multiply the value of a SELECT with an INPUT and display it in another INPUT? <!-- MULTIPLICAR ESSE SELECT --> <select name="papel"> <option value="">Tipo…
-
2
votes4
answers450
viewsUPDATE WITH SELECT AS A CONDITION
I have an app that sends an email to the user to confirm their email as soon as they sign up. Then I have two tables in my internal database, being them USUÁRIOS and LOGIN. In the table of USUÁRIOS…
-
2
votes1
answer410
viewsconnect in 2 banks with PDO
Hello, I connect in a bank , how would I connect with another, which has the same login and password within the same server ? follows my function: function conectaBanco() {…
-
2
votes1
answer43
viewsHow do to "explode" sometimes receive more values?
I have a code that reads a txt and saves in the database, only sometimes it will receive more values, example: I have the following txt: |texto|texto|texto| |texto|texto|texto|texto| If I use to…
-
2
votes0
answers41
viewsQuery in mysql grouping by days with Count returning value 0 if there is no day
Good morning I’m doing a db query as follows: SELECT IFNULL(COUNT(*), 0) as numero, DAY(cdr.calldate) as dia, MONTH(cdr.calldate) as mes, YEAR(cdr.calldate) as ano FROM cdr LEFT JOIN peers on…
mysqlasked 6 years, 3 months ago Jasar Orion 2,233 -
2
votes1
answer80
viewsHow to replace COUNT(*) in innoDB
I migrated data from a bank Myisam for Innodb and some VIEW were extremely slow (on average 15x slower), after much research found that answer from @Maniero and in it he makes a comparison between…
-
2
votes1
answer45
viewsDatagridview displaying incomplete id
The grid displays only the first character of the "ID" For example: if the ID is 16 it displays 1; If it’s 20 displays 2; However from 1 to 9 displays correctly... Code that selects the data...…
-
2
votes1
answer218
viewsAvoid Duplicity in PHP+Mysqli Registration
good night! How do I prevent registration with the same information? Currently my "processa.php" is like this, and I wanted to include the function mentioned above... <?php session_start();…
-
2
votes1
answer90
viewsHow to randomly select a row from each group in Mysql
Suppose I have such a table: item | group -------+-------- item a | group z item b | group y item c | group y item d | group x item e | group z item f | group x And that now I want to randomly…
mysqlasked 6 years, 2 months ago Jose Henrique 337 -
2
votes2
answers841
viewsArduino + PHP + Mysql
Guys, I know little of PHP I’m having some doubts... I’m wanting to implement a connection of the three systems mentioned in the title. The idea is to capture two sensor values and send them to php…
-
2
votes0
answers64
viewsProblem searching for the most recent result of a group in a query in two tables with PHP and Mysqli
I am studying mysqli and PHP to migrate a personal blog, from PHP 5.6 to 7 (mysql to mysqli), the blog has a table with names and other with items related to names, dates and times, below I will…
-
2
votes1
answer33
viewsIs it possible to count word order in a field via Mysql?
good afternoon! I’m not an expert in mysql - so doubt - q might even be silly. I have a field in a database where a color preference list is stored. Ex: Joao prefere: Azul, Verde, Vermelho. Maria…
-
2
votes0
answers238
viewsMethod of subtracting two values from the sum of records coming from the Mysql database
Good afternoon everyone, I’m creating a class that will work as a box where it will sum all the records found in the bank with the column in the value of INPUT and OUTPUT and at the end I subtract…
-
2
votes1
answer59
viewsProblems with MYSQL data return via include in PHP
I am starting a code for a warehouse control using PHP and MYSQL, and when making a document of function separated from index.php and perform proper variable insertions via include duly stated in…
-
2
votes1
answer299
viewsExtract column text from a table
I have the following table structure: The field metadata is like text type, but I believe it is actually a JSON. When I do: SELECT metadata FROM maxpay.mp_pay_orders; The result is:…
mysqlasked 6 years, 2 months ago Layla Comparin 553 -
2
votes1
answer193
viewsUsing $this when it’s not in the context of the object
I am trying to create a PHP class that connects to the Mysql database and am getting the following error: Fatal error: Using $this when not in Object context Connectdb.class.php class ConnectDB {…
-
2
votes1
answer75
viewsBring the sum of IDS and data into two tables using SQL
I need to make an SQL to bring me the data of: `DATA | QTDE IDTa | QTDE IDTb | VALORa | VALORb | Saldo (diferença de VALORa - VALORb) ` However I am not able to bring the data correctly with this…
-
2
votes1
answer84
viewsI am not able to enter data in the database
I’m unable to enter data into the database, I was using the PDO, but now I’m using the MySql, because I was only able to list database data with the MySql, I am able to list the data but I am not…
-
2
votes1
answer79
viewsSum subquerys values separately
I have a problem in this query below: select sum(tb1.l1) * 0.3, sum(tb2.l2) * 0.3 from ( select setor, total_geral as l1 from mobile.auditoria where month(data) = month(now()) and year(data) =…
-
2
votes3
answers1908
viewsHow to upload image using Spring Boot?
I’m learning to use the Spring Boot and I need to create a field in the form that loads the image to be used. How do I map the directory and save to a particular project folder? Example: through the…
-
2
votes2
answers515
viewsINNER JOIN in 4 tables
I have 4 tables: TB_OS_MANUTENCAO: TB_OS_ELETRONICA: TB_OS_MECANICA: E TB_OS_INFORMATICA: as shown in the images, all tables have a common field, calledid_, and also with a common value, 8. This…
-
2
votes0
answers820
viewsTruncated incorrect DOUBLE value. What error is this?
On this page I select the book id to display it and then update the visits field, incrementing it. <?php if(isset($_GET['id'])) { $id = $_GET['id']; } $livros = mysqli_query($conexao, "SELECT…
-
2
votes1
answer891
viewsAutocomplete with data coming from PHP
I am trying to create a form to register services performed, so I came across the first problem, I am trying to keep as light as possible because there is a lot of data. I intend to store the…
-
2
votes1
answer113
viewsError when checking user duplication
I wanted to prohibit the user from registering two iguas users, like two identical emails or matricula, but is still being recorded existing data, After that press in register and send the data to…
-
2
votes3
answers881
viewsHow to calculate difference of dates that are a previous row with MYSQL?
I have a table where I record the time when a particular request had its status_id changed. This table I call historico_status_solicitacoes. In this table, I have the following fields: id,…
-
2
votes0
answers29
viewsLogin with GORM with intercalated return between ID and 0
Guys, I’m learning to code in the GO language, and I made an api with a login system. func Authenticate(db *gorm.DB, auth models.UserAuthForm) uint { hasher.Write([]byte(auth.Password)) pass_hash :=…
-
2
votes2
answers51
viewsQuery does not work inside php
I made a query with a Join to get information from the database, I tested it in mysql and it worked perfectly, the problem is that it does not work in php, not from the error in the execution but…
-
2
votes3
answers458
viewsHow to Update to Linq?
My project has the Delete method, only it definitely deletes the table record in the database. I would like to instead of delete, change the column record, I have a field called "Status", this field…
-
2
votes1
answer137
viewsHow to pass mysql table field name as parameter via PDO PARAM?
I have a form where the user sets some criteria for the system to do a search for data in a mysql database. Among the criteria, the user can choose two search options. These options are two fields…
-
2
votes2
answers2340
viewsError: "java.text.Parseexception: Unparseable date: "2018-11-14T12:12"
I have the following data insertion interface: The comments below represent attempts to fix the error but none worked. In HTML the type is datetime-local, in the bank the type was created as…
-
2
votes2
answers224
viewsSelect Inner Join of what is not in the other table
I have two tables, Anuidades and Pagamentos. Of these annuities it is necessary to select the data of Anuidades which have not yet been paid. Table Anuidades Table Pagamentos To return the annuities…
-
2
votes2
answers725
viewsLoad BLOB to Image C# Mysql
I am trying to load an image saved in Mysql, however still unsuccessful. With the code below I can display all other fields. Every time I try to add some method to display the image, some error…
-
2
votes1
answer49
viewsHow to Insert MYSQL if Upload or URL
Hello, I would like to know how to make a mysql Insert, however in the way that I only used javascript to change the imput URL for File, that is, I’m trying to work on the same imput name, however I…
-
2
votes1
answer25
viewsView Logging a column in several other columns
I have the following tables: aud_agendas users On the table aud_agendas, there are columns condutor and aprovador_lancador. On the table usuarios, there are columns id and usuario. I need to display…
-
2
votes1
answer125
viewsHow to leave the date with Brazilian standard in Codeigniter 3?
Folks I’m developing an application that picks up the registration date from the register. But it’s picking up the date with American standard YYYY/mm/dd as I fix it in codeigniter ? Follow example…
-
2
votes3
answers98
viewsWith LEFT JOIN list the NOT IN
In Mysql I have the table usuario, with the fields ID and CPF: I received from the client a list with some numbers and what I need: See which of these users is NOT in the table…
-
2
votes1
answer49
viewsProblems with Mysql query
<form method="POST" class="w-100" action="pesquisa_diaria.php"> <div class="card-body"> <div class="row"> <div class="col-sm-3"> <label>Tipo de Venda</label>…
-
2
votes2
answers55
viewsWhy do if or case tests not work in this subquery?
I am trying to run the following subquery within a view: (SELECT if(idnotas > 0, "não", "sim") FROM notas WHERE vendas_idvendas = p.vendas_idvendas ORDER BY idnotas DESC LIMIT 1 ) as…
-
2
votes1
answer1041
viewsJava and Mysql - Error - Timezone
I try to connect with Mysql, with the code below. I don’t use Hibernate or anything. It is just to connect to the database and run a simple SQL clause. I get the error that is below. I see you have…
-
2
votes2
answers761
viewsConnection between two Docker containers
I created 3 containers to start my application, they are: version: "2" services: mysql: image: mysql:5.7 container_name: rgsistema-mysql working_dir: /application volumes: - .:/application…
-
2
votes1
answer115
viewsAdd one column values to two tables in Mysql
I am a beginner in programming and I would like to know how to add values of 1 column in 2 tables, both with the same data. Just rename the table... For example: Table teste1: nome | pontos | Joao |…
mysqlasked 5 years, 10 months ago Angelo Soares 366 -
2
votes1
answer106
viewsHow to join these two querys in one?
I have a table that records user reviews in Forum responses in rating, where: 0 = Vote No; 1 = Positive vote; 3 = Vote Annulled If I want to take all votes in response from a single user on a topic…
-
2
votes1
answer90
viewsCreate recycle bin table
I have the database tables to store the data, but I want to add one to save the data of deleted rows from the other tables, I thought of four ways to do this: Create a table lixeira that will save…
-
2
votes2
answers1326
viewsError when connecting mysql instance with nodejs
I raised with Docker mysql container docker run --name mysql-docker -e MYSQL_ROOT_PASSWORD=password -d -p 3306:3306 mysql But when trying to connect via Node node index.js the following error occurs…
-
2
votes0
answers35
viewsDifficulty Creating a Simple Variable Parser for Altorouter
I did a Simple Check of Variable PHP, but it was developed in Mysqli Base, the fact and that I went through some problems and due to this, I was forced to pass all the code to PDO, the problem and…
-
2
votes1
answer185
viewsPIVOT query in Mysql
I have a query in SQL Server using PIVOT that returns the data in column as image below: The query is this: SELECT * FROM( SELECT ftd.DateAndTime AS dt, ftd.Val AS Val, CONVERT(VARCHAR,…
-
2
votes2
answers343
viewsSql for plot counting
I have a billing chart. The significant fields are as follows: | vencimento | data_pagamento | valor_pago | I need to make an appointment to call me back: The number of unpaid arrears; The number of…
mysqlasked 5 years, 10 months ago Pedro Augusto 2,392 -
2
votes2
answers45
viewsProblems with Join Laravel ORM
Hello, I’m trying to create an advanced query, but I’m having some problems following the code for analysis! Anuncio::join('users', function ($users) use ($request){ $users->on('users.id' , '=',…