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
answer18
viewsHow to compress folder and download, how to proceed in a simple way?
I’ve been doing a lot of searches both google, forums and FB groups, but nothing that was explained was enough to clear my doubt, I believe that because I’m new in the area and I’m still pretty…
-
0
votes2
answers122
viewsDelete data from 3 different tables (Codeigniter)
I am trying to delete photos from a view, however, I need to delete beyond the photo table the data from two more tables that are linked to this photo. The code with the delete function is as…
-
0
votes1
answer29
viewsDIV of Failed Queries: Every derived table must have its Own alias
In a table, I have two fields: entry_time and exit_time. I want to subtract each record (Exit - entry) to find the wait of each client, add all the waits, and take an average of that sum by the…
mysqlasked 5 years, 6 months ago Jhonatan Cruz 23 -
0
votes1
answer51
viewsJSON_EXTRACT in Mysql by JAVA does not work
Hello guys I have a field in mysql called itemvenda of type JSON with the following data: {"secao": {"codigo": "114", "descricao": "FRUTAS 1"}, "gondola": "1", "cestaBasica": false, "departamento":…
-
0
votes1
answer85
viewsdata mask with php
I am trying unsuccessfully to replace the values returned from a database field, which returns a ckeditor html code. I’m trying to do it this way: $class = new Selecionar();…
-
0
votes1
answer136
viewsSQL: Copy records from a column
Using: Mysql I have this table called Licencas I need to get the column empresa_id and the coluna_id of this table And pass this data from these two columns to another table Calling for…
-
0
votes0
answers28
viewsERROR 1215 (HY000): Cannot add Foreign key Constraint (MYSQL)
Good evening, you guys, I am trying to create a table with two foreign keys, but is giving the error of Cannot add Foreign key Constraint, I do not understand why, follows below the SQL statement.…
-
0
votes1
answer65
viewsI need to make a query in the database. mysql
I have the following database. CREATE TABLE IF NOT EXISTS futebol ( id INT PRIMARY KEY AUTO_INCREMENT, nome VARCHAR(30) NOT NULL, estado VARCHAR(2) NOT NULL, brasileirao INT NOT NULL, copadobrasil…
-
0
votes0
answers322
viewsMYSQL ERROR 1442, how to resolve?
After inserting in "banco1.customers" I want to insert the same content in "banco2.Customers", but error appears. I saw that Mysql does not allow two operations in the same table, but they are…
-
0
votes0
answers27
viewsIs project structuring in multiple Mysql databases necessary?
Throughout the year I developed a school management project with a specific school. The project was building according to the demands and needs of the school, but as there was no intention it was…
mysqlasked 5 years, 5 months ago Henrique Casagrande Bravin 29 -
0
votes1
answer96
viewsMultiple COUNT() in a single query
Good morning, I have the following table: +------------+--------------+------+-----+----------------+ | Field | Type | Null | Key | Extra |…
-
0
votes0
answers32
viewsHow to search for data having the date eve as parameter?
I have no error in my code, my question is very simple: how to reference in the Where of a query that the search must be done by data from the day before to the current day? for example, if I have…
mysqlasked 5 years, 5 months ago Wilson Neto 1 -
0
votes0
answers79
viewsProblem with PDO::FETCH_ASSOC
Hello, everybody. I’m making a tag system for my blog. To get the tag id, I’m making a query using the IN operator. I want you to return only the associative array.That’s why I use PDO::FETCH_ASSOC.…
-
0
votes1
answer60
viewsInner Join and sub-query problems
This my query below serves to mount a table with data from multiple tables, however is giving an error: Error Code: 1242. Subquery Returns more than 1 Row 0,000 sec I think and the problem is in…
-
0
votes0
answers56
viewsRecover Larger ID in Database query
all right? I’m working on a client website, which was developed using codeigniter. The tables created by the programmer were not designed for some functions, and the client requested that I create…
-
0
votes1
answer73
viewsNotice: Object of class mysqli_result could not be converted to int in database.php
I’m having very specific problems while working on my crud. I created in the database a field called id, type INT and A_I and try to call it through this part of the code, but it keeps giving this…
-
0
votes1
answer269
viewsQuery Excel with cell criteria
I have a spreadsheet based on an SQL code powered by our database. But every month I have to enter the code and change the dates to get this information right. I want Power Query to use the values…
-
0
votes0
answers36
viewsI need some help in Trigger
So folks I’m needing a little help on some Mysql activities related to Trigger, basically it’s three Trigger. First Trigger should work after an update or Insert(something I’ll still put) the…
-
0
votes0
answers52
viewsSQL ERROR 1442. What can it be?
The error appears when I try to insert something in bank 3, because Trigger will be activated and will insert in bank2, but I am not performing 2 shares in the same table as the error tells...…
-
0
votes1
answer230
viewsCRUD - code help
a company asked to take a test and ordered a CRUD with Name, Email, Telephone and Address. Following the lessons from CRUD I tried to include two more items but it’s not working. I don’t know what I…
-
0
votes1
answer32
viewsSum variable within FOR
Good people, I need to generate a report where I search for people who have been present a day, the person may have more than one presence on the same day, but I need to pull only once, so I used…
-
0
votes0
answers25
viewsSearch results in a table of private conversations
I would like a help from you because I could not do with the topics I found on the internet. I have a "Chat" table with the following fields: And I’m using the following select: SELECT b.`id`,…
-
0
votes0
answers57
viewsForeach in Inner Join
Good afternoon, I have an sql query with Inner Join. $this->db->select('f.nome, f.sobrenome, h.habilidade'); $this->db->from('funcionarios as f'); $this->db->join('habilidades as…
-
0
votes1
answer87
viewsMethod to insert into the database is not pulling value [JAVA]
Good night! I’m trying to do a college job (JAVA), and I have to insert the client data into the database (Mysql), I have a Client class, a form, and the database class. Form calling method for…
-
0
votes0
answers17
viewsError of Input Characters
Good Night I’m making a registration system with mysql database, but I’m going through difficulties, I’m mounting the crud of displaying data is working perfectly but the insert I’m having trouble…
-
0
votes1
answer79
viewsPHP - Create an associative database array
I have the information below in a bank: And I want the result in an array like this: ['CLARO' => "IPHONE 8", "VIVO" => "MOTO ONE", "TIM" => "ZENFONE 6", "CLARO" => "IPHONE 8", "CLARO"…
-
0
votes1
answer239
viewssql result in spring boot
Good afternoon, I need help to make an endpoint in Spring Boot, in the database (Mysql), I have the following query: SELECT U.NOME, P.DESCRICAO FROM USUARIO_PERMISSAO UP JOIN USUARIO U ON…
-
0
votes1
answer53
viewsError making select with start and end date
I need to search the database for a list where it is necessary to filter by the employee, the initial date and the final date. However, when you pass the parameters and enter while, you jump to…
-
0
votes0
answers205
viewsError mysql Duplicate entry ... for key "UNIQUE"
Good Afternoon, I’m having trouble updating and inserting data into my mysql database, I’m making a php application but I’m not able to perform these update and Insert actions , follows the code…
-
0
votes0
answers215
viewsRelate field to mysql table
I need to do a test crud for a company. In this test, I had to create the Name, Email, Phone and Address fields, and it should be possible to enter more than one address by name in this CRUD. I…
-
0
votes1
answer278
viewsFilter of the month and year of a date via combobox
Galera is the following I have a table in my database where I have the data_process field that is in date format, so every time I register a process in the process registration form I select a date…
-
0
votes0
answers33
viewsIt is possible for a Mysql Trigger to insert wrong values
I have this Sp that updates the stock: CREATE DEFINER=`comandas`@`%` PROCEDURE `SP_AtualizaEstoque`( id_prod int, qtde_comprada int, preco_vend decimal(9,2)) BEGIN declare contador int(11); declare…
-
0
votes1
answer118
viewsHow to take query repetition
I created a chat, and I have a query to display the other accounts of the site to start a conversation. I put a select all, and it displays all normally, but now I need to put an order by to sort…
-
0
votes1
answer390
viewsHow to place ORDER BY in INNER JOIN/GROUP BY
In a chat, I need to give a SELECT in the contacts of the logged in user, but ordering them by the date of the messages The code is like this: SELECT contatos.*, contas.Key_User, contas.Login_User,…
-
0
votes1
answer67
viewsmysql - Query 3 tables at the same time
I have 3 tables, and need to make a SELECT inside a LOOP on 3 at the same time, would be as follows: note that the result, I take the username where it would be in the column NAME, I DO a num_rows…
-
0
votes1
answer261
viewsRegistering password 123 with MYSQL encryption, but only login with the password generated by the encryption
I’m no expert on PHP, SQL or HTML, but I’m good at copying things and turning them into something fun. So recently I went to make a website, to spend time, and I wanted the passwords registered in…
-
0
votes1
answer56
viewsWhat are the differences when including values (coming from a form for example), in a query mounted in PHP and executed in MYSQL, among the forms below?
I have studied and seen that there are different ways of treating data before inserting them into a query which is executed in the database. I have some questions about security and the issue of…
-
0
votes1
answer44
viewsQuery MYSQL does not order correctly
Hello. I have the following query: SELECT * from usuarios_cursos_matriculados LEFT JOIN cursos ON cursos.cedoc_doc_id_fk = usuarios_cursos_matriculados.cedoc_doc_id_fk LEFT JOIN cedoc_doc ON…
-
0
votes1
answer61
viewsMysql relationship between two tables
Good morning, for a work record I was given the following exercise: Imagine the following scenario. It is intended to create a database that supports the control of stocks. Each product belongs to a…
-
0
votes1
answer54
viewsHow to add registration to the list without harming existing data
Good afternoon, everyone, I have a model called User that has a permission list, example: @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @NotNull private String nome;…
-
0
votes1
answer76
viewsSQL - Perform the removal of two rows in separate tables connected with Foreign Key
Good afternoon, I have a little doubt on a personal project of mine. I own the tables request and itens_request which are connected by foreign key. As an example to simplify my situation: Requested…
-
0
votes1
answer208
viewsGrab id from the update button
Good afternoon, I’m trying to update a table, inside this table there is a button that saves the bank id, and sends this id to another page, that is this id needs to be used in two functions, I need…
-
0
votes1
answer58
viewsDifficulty in using LAG to catch the percentage of monthly evolution
I have the following table below and would like to catch the monthly evolution (%) of the total transactions per month. I researched the LAG function but could not understand very well. I need the…
-
0
votes2
answers44
viewsHOW TO ADD UP THE VALUE OF A PRO CLIENT COLUMN
Good afternoon Gentlemen, In benefit of my studies I am developing a simple sales system and I am already in the part of the reports. My doubt is as follows: How to make a select adding up the…
-
0
votes2
answers76
viewsSelect mysql of a ranking
Well I’m setting up a ranking of donations, the table in the database is like this: -- -- Estrutura da tabela `Doacoes` -- CREATE TABLE `Doacoes` ( `Cod` int(11) NOT NULL, `Doador` varchar(255)…
-
0
votes1
answer59
viewsProblems with Group By on Postgresql
I’m trying to make a view in a Postgre database: CREATE VIEW anuncio_points AS SELECT a.*, (CASE WHEN p.points is null THEN 0 ELSE sum(p.points) END) + u.points as points FROM anuncios as a LEFT…
-
0
votes1
answer29
viewsProblem with MYSQL data formatting
I am making a hotel management system using Javascript, Nodejs, Express and MYSQL. I need my date format to be DAY/MONTH/YEAR, this way: DATE_FORMAT(dt_entrada, '%d/%m/%Y') DATE_FORMAT(dt_saida,…
-
0
votes2
answers62
viewsHow can I set my variable "u"?
The following error is appearing: Notice: Undefined variable: u in C: Webserver Apache2.2 htdocs posts register.php on line 30 Fatal error: Call to a Member Function connect() on a non-object in C:…
-
0
votes1
answer28
viewsHow to access a vector within a PHP obejto and insert the data into the Mysql database
I would like to know how to access the array of addresses within this object: And insert the attributes inside a table in Mysql, I am doing it as follows foreach ($this->endereco as $elemento) {…
-
0
votes1
answer25
viewshow to register a new user setting SESSION as one of the query values
i want to register a new User by a manager and setting the company id in the bd, the way I did it worked when registering other tables but this is giving problem but I know that the value of Session…