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
votes2
answers41
viewsSave Column Name as item in another Column
Next, I have a table with several values and I need to compare the values of several columns, I did this with PHP and managed to separate the highest value, follows the code: while($aux =…
-
0
votes1
answer74
viewsProblem with PHP Expense Calculation
I’m trying to calculate expenses in the system but I’m not succeeding. The system works as follows, the User makes an order involving 1 or more products, these orders are stored in a table. Each…
-
0
votes2
answers48
viewsPerform multiple operations in a single SQL code
I have a table in Mysql as follows and structure: I would like to run an SQL query that does the following operations: Total number of records (total1); Count how many records have id_nps_answer…
-
0
votes0
answers42
viewsError installing mysqlclient on macOS with python 3
Error installing on macOS with python 3 pip3 install mysqlclient on macOS iMac-de-Qcx:~ gabrielveigalima$ pip3 install mysqlclient Collecting mysqlclient Using cached…
-
0
votes2
answers158
viewsSum of fields completed within the SELECT itself
I have an SQL query in the following format: SELECT XXXX AS duracao, calcula_horas_manutencao({data_inicio_f}, {data_final}, contrato.id) as horas_manutencao,…
-
0
votes1
answer420
viewsJOIN 3 tables (LEFT JOIN)
I have a question regarding the best way (concerning performance and execution) to make the following select... Initially I thought of using LEFT JOIN, but I came across some restrictions on its…
-
0
votes0
answers285
viewsCreate a Foreign key with two varchar fields
I’m finding it very difficult to create a foreign key between two tables, whose type is varchar: ALTER TABLE netmap ADD CONSTRAINT fk_IP FOREIGN KEY ( IP ) REFERENCES ipvalidos (IPS); The mistake…
-
0
votes1
answer259
viewsHow to perform a recursive query with the relations stored in a JSON array?
I have a MYSQL table that relates to itself. The relations are represented in the same table through a JSON Array. Here is the table and some sample data: CREATE TABLE `templatedata` ( `Id`…
-
0
votes1
answer31
viewsLosing value of POST fields when user connection is slow
I have a problem when users update the site and in the middle of the action their connection slows down or falls and comes back quickly at the time of the process. Sometimes the user only updates…
-
0
votes2
answers683
viewsIs it possible to use Inner Join in several columns of the same table in a Select?
In the database there are 2 related tables. Collaborators: Events (here makes the input of training time by collaborator): I need to know the total training time of each sector. Select below works,…
-
0
votes1
answer382
viewsHandling date and time in PHP
I have a question. I would like to know how I can do so that the php code stores the time I registered an activity, but it should be hidden in the form and only visible when this data is visible in…
-
0
votes1
answer30
viewsHelp with logic UPDATE using queries
It’s the following guys, I have two tables, the table esc_usuarios which contains information from registered users and esc_usuarios_slog, that contains the records of the casualties, in which they…
-
0
votes2
answers434
viewsError server Timezone is unrecognized wildfly 14 Connector/J 8.0.13
I am configuring my environment using wildfly 14.0.1.Final and mysql-Connector-java-8.0.13. I have the following error when I set up the Connection profile and do a connection test:…
-
0
votes1
answer131
viewsHow to enter the PK value of a table in the FK of another table
I created a table usuario using: CREATE TABLE usuario( usuario_id int NOT NULL auto_increment PRIMARY KEY, nome varchar(200)); Then another table using: CREATE TABLE image( id int NOT NULL…
-
0
votes1
answer42
viewsInsert Mysql Database
I need it to be inserted into the Mysql Database (table fotos) the path that is defined as $target_file_name. I believe the mistake is probably at the moment of INSERT. Filing cabinet conexao.php:…
-
0
votes0
answers40
viewsI cannot import all xml sublevels with PHP
I have a function to import the xml file: $xml = new SimpleXMLElement($arquivoxml); foreach($xml->Imoveis->Imovel AS $itens) { $ref=$itens->Id; $atributospai = $itens->Atributos; foreach…
-
0
votes1
answer56
viewsSELECT TO REDUCE SEVERAL SIMILAR MYSQL ENTRIES
Good morning guys, I have searched and found nothing very useful. I have an inventory database of my Network Stations. The agent installed on each station sends the installed program names to the…
-
0
votes1
answer31
viewsNot registered with Banco Javaweb Primefaces
Productive: public class ProdutoDao implements IDao<Produto> { @Override public List<Produto> listar() { Session session = null; try { session =…
-
0
votes0
answers98
viewsCodeigniter- Query in database always returning null
The getlocal function which is a query in the database is always returning null even after I do an Insert in the database denuncia_model.php file class denuncia_model extends CI_Model { function…
-
0
votes2
answers62
viewsDatabase Image Inclusion - Longblob
I am coding a simple register, where it also needs to record a photo in the database, which should be the Tibo BLOB. This is my Class Person: public class Pessoa { private Integer idPessoa; private…
-
0
votes1
answer31
viewsCompare id of two tables and insert value when id does not exist
Hello, I’m comparing two tables that have the same data, tabela1 and tabela2, to tabela2 will have data deleted over time, and so need to identify the field that was deleted and insert an "delete…
-
0
votes1
answer284
viewsPHP Mysql error - mysql_num_rows()
I’m having trouble correcting this error, I don’t know much about language (almost anything). The error that appears on the page is this: Warning: mysql_num_rows() expects parameter 1 to be…
-
0
votes2
answers32
viewsProblem with call in Database
Next person I have several calls that update a database as the user fills the fields but specifically in the following error call in the database and not saved for anything, and all use the same…
-
0
votes0
answers120
viewsSearch via GET does not return results correctly
I’m having a problem with a GET search. I have the following code: <?php //envio o charset para evitar problemas com acentos header("Content-Type: text/html; charset=UTF-8"); include_once…
-
0
votes1
answer80
viewsMysql query - How to select products that were returned before they were purchased using sql only
I have the following table of a mysql product movement database which contains the following fields: id | prod_id | prod_name | movimento_tipo | data_transaction 1 | idProd1 | tv | ordemCompra |…
-
0
votes1
answer36
viewsHelp with project code organization
I joined a project written in php that at first had no idea of the proportion it would take. So I’ve written so much code that even I’m a little lost to locate some problems. To do the project, as I…
-
0
votes0
answers154
viewsUse INNER JOIN with WHERE clauses
Guys, I am reassembling a system before in ASP now in PHP already with database loaded and mounted, but I need to do some filters where I need to fetch data from at least 3 different tables and…
-
0
votes1
answer46
viewsJoin show later dates only
I have a table that records steps of a drive. For example: Data - Movimentacao - Produto 2018-01-10 - produzido - id1 2018-01-11 - embalado - id1 2018-01-12 - despachado - id1 2018-01-10 - produzido…
-
0
votes0
answers51
viewsQuery in mysql grouped by hour
Good afternoon. I am performing a query in mysql and this returns the precise values. My problem is to display the values that do not return by e.g.: I asked to group by hour or day it only returns…
-
0
votes2
answers100
viewsSelect with reference in several tables
I have three tables: PRODUTOS, PEDIDO and ESTOQUE, and I want to list all the stock by order and by products, as shown below: products codigo tipo medida 3020 | unico | 3 3021 | unico | 5 3022 |…
-
0
votes0
answers23
viewsNullpointerexception
I have a button that takes 2 text fields and sends to Mysql by MVC standard only it is giving a java.lang.Nullpointerexception q do not know how to solve The code of the button private void…
-
0
votes1
answer238
viewsPHP cannot process heavy files
I have a PHP system that reads a TXT file, and performs an REPLACE in the database for each line, it does this well with small files (About 100 lines), but when I do with giant files (Over 1 Million…
-
0
votes2
answers37
viewsGenerating sequential Ids for each user in the same Mysql table
I have always used the primary key itself as the default identification code for each record in a database table. Once the table has been used by several users, and each one has its own registered…
-
0
votes1
answer61
viewsHow to list values of multiple queries in a single table?
I have a table with the columns attendant, total/day and total/month. I listed on tr/td the names of people through the first MYSQL query. I need through the second query to sum up the records of…
-
0
votes0
answers47
viewsHow to unify the value of a column by making a group by of two different columns?
I’m trying to do a query that needs to bring the month percentage of each row to it I did the query below: SELECT linhas, month(date) as `data`, round((`M3.0`*0.3),2) + round((Produtividade*0.2),2)…
-
0
votes2
answers55
viewsInsert only the populated row in the table
Table code: $j = 0; while($rows_cursos1 = mysqli_fetch_array($resultado_cursos1)) { $tabela2 .= '<tr>'; $tabela2 .= '<td> <input type="text" readonly="true" size="20" name= "Carro[]"…
-
0
votes1
answer33
viewsHow do I query the database 10 days ahead and 10 days behind the current date?
Today I can already do the consultation 10 days ago as shown in the query below, I’m just not able to deploy the 10 days ahead of the current date. SELECT `vw_saldobancario`.`contaApelido`,…
-
0
votes0
answers49
viewsError when registering data in the database :(
I am trying to make a system of registration of companies, but it does not work. I am doing everything right to my view. The bank is the same, the variables are right and the functions are right. I…
-
0
votes0
answers50
viewsLock the timepicker button
<?php include('ligabd.php'); $id=$_GET["id"]; session_start(); if(isset($_SESSION["id_cliente"])){ }else{ header("location:login.php", true, 301 ); } $successMsg=''; $consulta = 'SELECT * FROM…
-
0
votes0
answers131
viewsCreate Mysql Trigger with input condition
Hello, I’m doing a credit card system and I created a column with the types of card using ENUM('bronze', 'silver', 'gold'), now I want to create a Rigger so that when the user enters with the type,…
-
0
votes1
answer771
viewsGet the latest record by date from a mysql release history
I need to pick up the latest donation situation at a certain time. I need to group by donation and by situation. Add by situation and order donations by situation, taking only the last. Tabela…
-
0
votes1
answer107
viewsDoubt with foreign key
To register the matches of a football championship the following tables were defined: Time ( id int primary key, nome char(20), pontos int, nroVitorias, golsMarcados int, golsSofridos int ) Jogo (…
-
0
votes1
answer552
viewsHow to encrypt the password in the registration of a new user and how to recognize it in the login of this user?
this is the code that processes the register <?php include_once("conexao.php"); $nome = $_POST['nome']; $celular = $_POST['celular']; $email = $_POST['email']; $senha = $_POST['senha']; $sql =…
-
0
votes1
answer88
viewsUpdate filter of a table based on information from another table
Hi, I need to make one UPDATE in a table (in the example the table 'reservations'), based on information from another table (in the example the table 'administration'). Good so far I managed to do…
-
0
votes1
answer51
viewsseparate array and query in bd
have a variable $servicos that receives the list of services registered in the BD through this code. $query_servicos = "SELECT * FROM servicos ORDER BY nome ASC"; $result_servicos =…
-
0
votes0
answers167
viewsdifficulty with access to mysql
I am trying to connect remotely to a mysql in google cloud, but I can’t. in google I created an Ubuntu vm, last version, this is my ip, this dripping normally: I configured the firewall as follows:…
-
0
votes2
answers47
views -
0
votes3
answers721
viewsSelect Distinct is bringing duplicate Mysql data
I need to bring only the last record of each id_face that has in the table imagens, but for some reason it’s bringing id_faces duplicates. Follow my consultation: SELECT DISTINCT(i.id_face) as…
-
0
votes2
answers128
viewsBank registration via Ajax
Good afternoon. I’m a beginner in the world of programming, and I’m developing a web app and I’m having problems to register sales in the database. The system must insert new inputs to register more…
-
0
votes1
answer290
viewsInnerjoin with 3 Mysql tables
I am trying to make a query that when I type the name of a product, return me the sector code and the image associated with that sector but my innerjoin is not working I’m trying to do it like this:…