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
votes0
answers23
viewsBring result from a select that depends on another
Good morning, I have a question regarding SQL. Currently I have 2 querys where one needs the result of the other to return everything I need, and I wanted to know if I can transform the 2 querys in…
-
0
votes0
answers32
viewsMYSQL - How to Filter the Output of a main Select that has as one of the fields the result of a subquery?
Good afternoon Srs, this is my first post here, but I’m always researching the posts and the doubts of the people. I have the following situation: I CAN get all results, but I cannot FILTER what I…
-
0
votes0
answers33
viewsDifference of results between sum with pivot and sum of counters
Hello, I would like a support to understand why the following two querys produce different results. The strategy I searched with them is the same, to count and group Sip results with different…
-
0
votes0
answers13
viewsHelp with UPDATE considering foreign keys in MYSQL
Hello, good afternoon. I’m trying to make a data change on a table that needs to work as follows: I need to write a Query that UPDATE table 1, with the ID of table 2, but first, make sure to only do…
-
0
votes1
answer26
viewsChanging primitive fields and constraints Modify with MARIA DB
The commands Modify and change column are used to change both the primitive fields and the constraints and field name. alter table pessoa modify column profissao varchar (30) not null; alter table…
-
0
votes0
answers13
viewsWhy does the sequelize id auto-increment even without adding the data?
Hello, I have a table that has[id, user, password, level] following these settings: id: { type:sequelize.INTEGER, primaryKey: true, autoIncrement: true, allowNull: false }, user: { type:…
-
0
votes0
answers17
viewsFunction to query value in the database and return boolean value
Person, good night! I am a beginner and I want to create a function that sees if the value exists in the database and return me true or false. I tried to do so but when printing the result of this…
-
0
votes0
answers17
viewsHow to consult the Database via Ajax?
In Asp Net Core (I have 03 Models - I will describe well summarized): (Model 01) public class Estudante { public int EstudanteID { get; set; } public string EstudanteNome { get; set; } } (Model 02)…
-
0
votes0
answers17
viewsSQL - Using COUNT doubt
Hello, I have the following question: Select the id and the total number of rentals (rental) of the ((a) client (Customer) that made the largest number of rentals. (tip: use COUNT, MAX, nested…
-
0
votes0
answers18
viewsUsing Datatables in cakephp
I wonder if anyone has any examples of how to use Datatables (server-side Processing) in cakephp (version 3.0 onwards). I was able to do it in php and it’s working. However, when I try to use the…
-
0
votes0
answers23
viewsQuery mysql UPDATE is doing the INSERT function
I created a function to modify the data of a DB regarding a particular product: public function editarProjeto(int $id, int $categoriaID, string $titulo, string $ano, string $descricao, string…
-
0
votes0
answers24
viewsTable relationship command not working
Good afternoon, I have a function with a query to search a list of photos of a certain product in the Product class: class Produto { private $mysql; public function __construct(mysqli $mysql){…
-
0
votes1
answer33
viewsDuplicate column of a table for itself by changing only the ID
Good morning everyone, I have a doubt and I found nothing similar that can help me, I need to create a copy and put function or duplicate everything this information and generates a new ID keeping…
-
0
votes0
answers12
viewsConnect Laravel application on WSL2 with database on Windows
I have a portable application using WSL2 that runs normally. I had a recent problem when I needed to connect this application with the database that is installed on Windows. I tried to connect…
-
0
votes0
answers16
viewsMYSQL ERROR #1442 - Delete with a data-based Function of a select
I was trying to remove repeated values from a table, I needed a group by and a limit, I could only think using an extra Function: DROP FUNCTION IF EXISTS func; DELIMITER // CREATE FUNCTION…
-
0
votes0
answers12
viewsExecute a Mysql command(event) if the "item" is not in two separate databases
Hello is basically the following is a Webgame where every 5 min runs the regeneration command, the command would be this: UPDATE `_personagens` SET vida = IF( vida +(vida_m * 0.05)> vida_m,…
-
0
votes0
answers9
viewsI have a MYSQL and TYPEORM database like Orm, when I start the server, 2 FK columns are added in a table
When I start the server, typeorm logs these changes: query: ALTER TABLE `topresente`.`classes` DROP COLUMN `class_id` query: ALTER TABLE `topresente`.`classes` DROP COLUMN `subject_id` query: ALTER…
-
0
votes1
answer30
viewsSum values from a column in the table where the date repeats, in a SUB-SELECT
Dates are different in your hours as this example: +---------------------+-------------------+-------+ | DATA | callid | tempo | +---------------------+-------------------+-------+ | 2021-08-01…
-
0
votes1
answer23
viewsHandle array objects from AJAX
Good afternoon guys, I read the whole forum and tried several things, but I can’t extract the data from the array to manipulate. Well, I’m putting together a system where, after making a sale, it…
-
0
votes1
answer20
viewsUpdate with Where in two different database
I want to update the supplier database, in the hydro table, where the cod_barra field of the hydro table already has in the company database, in the products table. That is, I want to turn all bar…
-
0
votes0
answers15
viewsQuery between two tables is returning NULL value
i am trying to make a query that will join some tables in my database using a Join. The tables are as follows:: Table 1 - RESULTADOS_SIGLAS +--------------+-------------+-------+ | ID_RESULTADO |…
-
0
votes2
answers19
viewsHow to use select with php and Pdo
Hi, how are you? I am learning database with php, was creating a class named crud where there is a select function to remove data from the database, however, after select, the result is always 0,…
-
0
votes0
answers9
viewsError when exporting a database using mysql Workbench 8.0
This is my first time using Mysql WORKBENCH, I’m having problems when exporting a database. In the image below are the parameters that I configured in the Data Export tab before starting the…
-
-1
votes2
answers111
viewsSend data to Database
I have a database with the following primary and foreign keys tb_detalhe_trabalhador id tb_funcoes_id tb_trabalhador_id tb_equipamentos id tb_trabalhador_id tb_funcoes id tb_trabalhador id My last…
-
-1
votes1
answer117
viewsForm Receive in 2 different tables
I have this code to receive data on two different tables. But only the first table is receiving data. The second table is still blank. It is possible for this code to work this way?…
-
-1
votes3
answers1762
viewsPhp MYSQL query several tables
Good, I’m having difficulty showing the data of a database using 3 tables. <?php include("conectar.php"); $quantidade = 1; $pagina = (isset($_GET['pagina'])) ? (int)$_GET['pagina'] : 1; $inicio =…
-
-1
votes2
answers702
viewsUpdate data File
I have a question about changing FILE data. <?php include("conectar.php"); $id = $_GET['id']; $sql = mysql_query("Select* From tb_trabalhador WHERE id = $id"); while($exibe =…
-
-1
votes5
answers1314
viewsPHP connection problem with Mysql
All the settings are right I don’t know why not connecting.. locally works, but when I step to the server gives this problem. $hostnome = '192.185.176.204'; $usernome = 'tookc892'; $senha = '***'…
-
-1
votes1
answer1823
viewsBinding Tables with Code Igniter
I have the following problem, I have a table of customers that stores personal data, login, password among others, and another table of invoices, which has all invoices of all customers, but I need…
-
-1
votes1
answer339
viewsInstallation My SQL
I am installing Mysql Server on my machine following the step by step, but finishing the installation does not show the Server Configuration Wizard (Mysql Server Instance Configuration Wizard). I…
-
-1
votes1
answer428
viewsMysql temporary table
How to assign an update to a temporary table in my case I do an update right at the beginning, create a temporary table and then a Rigger(trigger) in this trigger I try to assign the values changed…
-
-1
votes1
answer625
viewsProblems filtering field with LIKE in Mysql
I have a table that has more than 1 million data that I want to filter through an acronym that can be anywhere in the String field. It has BTREE index in Mysql. I’m doing it this way: select…
-
-1
votes2
answers919
viewsSeparate time and search between dd/mm/yyyy dates
I have a contract table called contract two-column data_ini and data_fim. data_ini and data_fim are as follows: 20/04/2014 10:46 I need to do a search between dates, without the time. If I didn’t…
-
-1
votes1
answer100
viewsMysql connection by Pdo does not exist
I can’t connect to my database, I have no errors, the connection just doesn’t happen, just gives me a blank page. I have these 4 small files responsible for Conn. init.php: <?php session_start();…
-
-1
votes1
answer868
viewsUPDATE does not update table
I am unable to update my fields. Where I am missing? Caught the id through GET and I can display the table data, but I can’t update it. CAMPOS $id_destino = $_GET['id_destino']; $destino =…
-
-1
votes1
answer339
viewsConvert to decimal number
I have a script that calculates the total values and then demonstrates the total value in an echo. The problem is that the value is demonstrated without colons or commas, ex: 82700 to: 827.00 would…
-
-1
votes1
answer80
viewsMysql sub-base 1
Motta, Thanks for the agility, but this instruction is showing only the highest salary. I tried the INNER JOINT, and almost got it. Imagine that I want to compare the salary of people with the same…
-
-1
votes3
answers138
viewsCannot capture sql error
try DModuleGrid.ZQuery1.Close; DModuleGrid.ZQuery1.SQL.Clear; DModuleGrid.ZQuery1.SQL.Add('SELECT * FROM tdcupant'); DModuleGrid.ZQuery1.SQL.Add('WHERE numcupom = :co2 AND ccf = :cc3 AND dtcompra =…
-
-1
votes1
answer110
viewsInsert form data in the same table
I have an extensive form so I separated the HTML and various parts but I want to continue to save in the same table. Example: $sqlinsert = "INSERT INTO tb_detalhe_trabalhador (Nome1, Funcao1,…
-
-1
votes2
answers1101
viewsHow to create upload files without using "input file"?
How do I upload files without including input file, that is, only using textField in HTML? I managed to solve staff follows below the solution <?php $numtotal=5; $erro;…
-
-1
votes1
answer155
viewsGroup Mysql Values
Dear, I have a table with the configuration: Tipo Medida Valor 1 0.2 5.00 1 0.4 6.00 1 0.1 5.00 1 0.3 5.00 2 0.1 3.00 2 0.2 3.00 2 0.3 5.00 2 0.4 5.00 I would like to group the values where they…
-
-1
votes1
answer66
viewsINSERT in mysql in another domain
Insert mysql into another domain. For example: on my site has the site administrator, and there I can register my products, when registering, will register on my site and on another site outside my…
-
-1
votes1
answer139
viewsInsert images into database
Good afternoon, I entered a lot of information in a table in my database through a file. csv using the LOAD DATA INFILE command line and I also have a relationship table where the product ID and the…
-
-1
votes1
answer412
viewsProblem with PHP paging
I’m having problems with paging, I have the main page where you can find the whole structure of my site, called main.php where there is the switch to open the files, so. MAIN PAGE.PHP switch(@…
-
-1
votes1
answer635
viewsHow to insert timestamp value into a Mysql table?
I am receiving a timestamp value from a request, and would like to store this value in my bank, however I want the column to interpret it correctly. The value is 1416178487. And using the function…
-
-1
votes1
answer1575
viewsHow to put the data of a while inside a variable?
This code returns me several values of the database: while($TiV = $frm_interesse->fetch()){ echo $TiV['CODIGO']; } ... and I need to send these values by e-mail with the PHPMailer. I need some…
-
-1
votes1
answer898
viewsConnect Mysql hosted on another server
I have Centos installed with php+apache working this centos is local but I want to use this local server to connect to a mysql database on an internet server. I have Firebird installed in this…
-
-1
votes1
answer557
viewsDelete on an UPDATE Trigger
How can I delete a record that is being entered in a specific condition in a Rigger? example: USE `scompraslenovo`; DELIMITER $$ CREATE TRIGGER `precad_fornecedor_BUPD` BEFORE UPDATE ON…
-
-1
votes1
answer48
viewsAny explanation for this SQL?
$alters = " ALTER TABLE imovel MODIFY COLUMN ENDERECO VARCHAR(150), MODIFY COLUMN BAIRRO VARCHAR(150)"; $pdo->exec($alters); As I decrease the varchar value, it updates, but if I increase the…
-
-1
votes1
answer390
viewsHow to enter this information in the mysql database?
$pegacodigos = mysql_query("SELECT CODIGO FROM imovel"); while($codigo = mysql_fetch_array($pegacodigos){ ... Erasing and writing all over again: The $pegacodigos through a loop picks up all the…