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
answers46
viewssearch results from a select
I wanted from one or several selects to fetch information from the database and insert that data into the page as text. This is to be an "invoice". Example: Code: <form method="post"…
-
0
votes1
answer307
viewsCreate a Trigger with JOINS
Good afternoon, everyone, I have two tables: SELECT [CodigoProduto] ,[CodigoDistribuidor] ,[Produto] ,[ProdutoLimpo] ,[NomeMarca] ,[StatusProduto] ,[ChaveProduto] FROM [dbo].[Produto] GO SELECT…
-
0
votes1
answer87
viewsI need the GROUP BY clause read after HAVING
My problem is the following, the distance is the crucial information for my research, and I need to use also GROUP by not to appear several equal products! Then as the group by comes before the…
-
0
votes0
answers102
viewsRegister Data in Mysql using Ajax and PHP
I am trying to register a date field for a service registration system and the queries are not being sent to the database. I tried using only PHP and it worked, but when I use the same code with…
-
0
votes1
answer52
viewsPerform sum of hours from a query
I am in need of a help in a system that I am developing, it is based on an electronic point system I am almost finishing it, and to complete once I need to perform a calculation of worked hours of a…
-
0
votes1
answer421
viewsLoop inside SQL loop
I have the following code in a procedure in the mysql: BEGIN declare v_unidade varchar(10); declare v_conta varchar(256); declare v_cnt INT; DECLARE done INT DEFAULT 0; declare c_unidade cursor for…
-
0
votes1
answer46
viewsMake a database query through an array
Hello, Guys, I got a big question here. I have a query where the user can select if they want to see all(Manager and Managers Jr), Only Managers Jr, or Directly select only one. All Only managers Jr…
-
0
votes2
answers48
viewsPlace alphabetical order increasing the description, when the result comes from a search through numerical field
I now have a question, how to put the relationship of employees of a certain function code in ascending alphabetical order. I’ll put the code down: <table align="center"> <tr> <td…
-
0
votes1
answer397
viewsQuery mysql username in php
Good afternoon, I am developing a website for my TCC, I am still apprentice in developing sites with php. I’m trying to get the user to enter your page to receive welcome with your name searched in…
-
0
votes1
answer61
viewsTable that changes color
Good afternoon everyone, I am beginner in php would like to know how to change the color of a table that receives the database information. For example I have a technical intervention form where I…
-
0
votes2
answers55
viewsQuery to collect data from multiple columns of the same row, by Primary Key of the record
all quiet?! See if you can help me! From the query below (use phpMyAdmin), I only need to bring the results of "LETRAA", "LETRAT", "LETRAG" and "LETRAF" to the browser screen (via PHP), but I do not…
-
0
votes1
answer125
viewsSet OPTION as Selected based on Bank values
I need to create a condition so that if the bank option is Smartphone or Common Device that appears in Selected, otherwise it appears as "Select". <div class="form-group col-md-3">…
-
0
votes1
answer241
viewsHow to make a total disjunction in EER diagram? (Mysql Worckbench)
Hello, I need to deliver a sales system and I need to make the entity "payment form" one of these sub-classes (card, check, billet or deposit), only one per instance... How to represent the…
-
0
votes2
answers860
viewsNestjs with Typeorm for Mysql - Nodejs
I’m starting in the area so sorry if it’s something silly. I started developing a server using Nestjs with Typeorm to connect to a Mysql database but am picking up the following error: 'No…
-
0
votes1
answer49
viewsReply of the full query of line breaks
Hi, I have a problem with the query answer I made to db is full of \n and \ . Does anyone know what the problem might be? Thank you. model function, query a db in search of products added to cart by…
-
0
votes0
answers47
viewsPROCEDURE WITH MEDIUM
Good morning, everyone, I have the following tables: Create table FUNCIONARIOS (num number, nome varchar2(30), custo_hora number); Create table PROJETOS (cod number, nome varchar2(15), custo_acc…
-
0
votes1
answer25
viewsProblem with Order By Case Over 9 When
How to correctly use ORDER BY CASE WHEN with more than 9 records ? In the example below I am using a case when with more than 9 records and when it arrives at position 10 , 11 ,12 e 13 the order is…
-
0
votes0
answers55
viewsRun script on remote server when new entry is in Mysql
For security reasons, I have two servers. In one is hosted the site with the entire user interface and DB Mysql, and in another is hosted the application that will run the script from the user…
-
0
votes1
answer140
viewsSum at time of INSERT with php
I’m trying to make a sum at the time of a INSERT in a table but I’m having difficulties to accomplish, in my case, the sum needs to take into account a grouping by phone number and user, for…
-
0
votes1
answer41
views -
0
votes1
answer100
viewsCheck whether array contains selected value in a mysql query with PHP
I wonder if you could help me? I need to check if array contains a specific value in a mysql query. In a function I get the day value of the week: $wekc = 4 In table tb_turg, I own the weekg column…
-
0
votes1
answer95
viewsI need to update the value of one SQL table with the sum of the values of another
I need to update the value of the column total_services of a certain number with the value (value value value * quantity) of the table nfpse_detail The command I’m using to try to do this is this…
-
0
votes1
answer24
viewsSQL - How to take a data from a table and insert another preset?
I have a website and need to create a code to send badges, my problem GRAAANDE is, SQL is giving error The idea is to insert in the table "usuarios_placas" the username and the emblem code…
-
0
votes3
answers121
viewsCompare birth date registered in the database to a custom date - mysql
Good afternoon, I am displaying a report, where it is to show customers who own + 60 years. Like me nay own a field idade in the comic book, I had to "discover it" by birth date and did so: SELECT…
-
0
votes2
answers103
viewsMy container with Springboot is climbing before the container with Mysql finishes climbing
Docker-Compose.yml version: '3.5' services: marvel-api: build: my-api container_name: my-api depends_on: - my-api-bd restart: always ports: - 8080:8080 my-api-bd: build: my-api-bd restart: always…
-
0
votes1
answer55
viewsCursor does not update Level (SQL)
Good night, I am making a cursor that updates the table level column of schools with the following rules: a. Schools with more than three levels of education are graded with category A b. Schools…
-
0
votes1
answer44
viewsHow to define the same INNER JOIN for different fields related to the same table
I have a problem which is this, in the mysql i have a table portaria who has a Fk_key with the table usuario, which is who authorizes, and, a relation N to N with the table usuario for those who…
-
0
votes1
answer133
viewsHow to treat an sql command in the Laravel controller?
Good night, you guys. I followed the dompdf tutorial successfully for static texts, now I wanted to make a query in the database to print the results in tables in a pdf and I get this error:…
-
0
votes1
answer69
viewsHow to capture Mysql error 1452 and present message to user?
I have the function below that makes the insertion of a new record in a database. // INSERE UM NOVO REGISTRO NO BANCO DE DADOS function save($table = null, $data = null) { $_SESSION['message'] =…
-
0
votes0
answers45
viewsDAO method returning attributes of more than one object
I have a question in the use of DAO. If I need to return a set of attributes of 2 objects? Let’s say I have a DAO category that has a method that in addition to the category attributes needs to…
-
0
votes1
answer37
viewsRemove part of data entered by the user
I am developing a website for sending videos to teachers, for this, I made a form with the following fields: Considering I’m still learning PHP. I would like to know if it is possible to have the…
-
0
votes1
answer42
viewsSend user name in SESSION with form
I am sending a form as follows: After uploading the video, I would like the uploaded video table to include the name of the uploaded user as well. I tried with post and get method as follows:…
-
0
votes1
answer98
viewsHow do I set up a column to be composed in Mysql with Hibernate (Java)?
I’m doing a CRUD and in creating my model I’ve reached a point where I can’t get out. I have a table "Plan" and each plan can have several "Modalities", as well as several "Extras", but I do not…
-
0
votes1
answer2080
viewsNode and Mysql connection error in Docker Compose: Error: connect ECONNREFUSED
I created a file docker-compose.yml to load a Mysql database and a Nodejs server: version: '3' services: database: image: mysql:5.7 container_name: 'database' restart: 'always' volumes: -…
-
0
votes1
answer90
viewsField of type ENUM empty arrow when not a valid value
Test scenario Data set: 10.4.11-Mariadb Table: tabela Campos: id (INT, PK, NOT NULL), ativo (ENUM('S','N'), NOT NULL) Instruction UPDATE tabela SET ativo = 'XXX' WHERE id = 1 Return 1 Row(s)…
-
0
votes1
answer692
viewsPage with Nodejs with Mysql database
I’m creating a API to then be consumed in React. In this API you will have a route(page) that will list database users. I applied the rules and I’m testing in India, which by the way is working…
-
0
votes1
answer394
viewsDatatable Server-Side error ( Invalid JSON Response ) - PHP
Good afternoon, community! I’m cracking my head a little, trying to use Datatable Server-Side to solve my problem, first time I’m having contact with the same. I’ll be dropping my code, and I’ll…
-
0
votes1
answer123
viewsTable structure for calculating financial transactions in Mysql?
I’m developing a system that will have financial transactions. In this system the user can enter or withdraw money, can buy and sell products, send money to other users, and etc. Currently I have a…
mysqlasked 5 years ago Bruno De Souza Carvalho 86 -
0
votes1
answer47
viewsError while performing max(sum())
I’m trying to solve the problem to find the state with the largest number of cities starting with saint/saint. For that I realized this view: CREATE VIEW SANT AS ( SELECT E.NOME ESTADOS, M.NOME…
-
0
votes0
answers20
viewsMultiple select comparing two database lists
I need to make a multiple selector in HTML, and the list of items will be loaded from a Mysql table using PHP, however, I want the values that are already in another table to be filled…
-
0
votes0
answers19
viewsRegister Forms array in the database
I have a form that is dynamic, the user chooses how many input will appear. <div class="container"> <?php $g = $_GET['id']; ?> <form method="post" action="upload.php?id=<?php echo…
-
0
votes0
answers78
viewsI need to create a Mysql Trigger to create a table with the name containing the id of the last row inserted in another table
I would like every time a row was inserted into the chats table, a new table was created. The Table must have the name of the value inserted in the chat_id column of the chats table. Ex: If the last…
-
0
votes1
answer79
viewsHow to optimize my paging (Datatable) using LIMIT?
all right? I’ve been having some problems for a while, with a table of my system, my table has only 430 records, and whenever I give "F5", perform a INSERT or something like, the "time/delay" table…
-
0
votes1
answer38
viewsGuys, I have a question with Mysql about Procedures. Is it possible to save their return in a BD variable?
I have a repetitive process in BD that is validate the user for each request, so I decided to create a process for this and call inside the others when necessary. However I have the need to save the…
-
0
votes0
answers345
viewsHow to save picture blob with multer in nodejs
Well I have this table: And I have this code that I get an image by the woman in the nodejs: routes.post('/salvarImagem', upload.single('Img') , (req, res) => { const connection =…
-
0
votes2
answers34
viewsHow to get the name of another table when the Ids match?
Well, I’m a beginner in php (although I’m trying to learn), and at the moment I’m stuck in my last step finishing a php file. I have a table called "Team", where there are columns called "ID" and…
-
0
votes1
answer39
viewsPass Select sql to the default used in Laravel
In my phpMyAdmin, I use the SQL below: select categorias.id as categoria_id, nome as categoria_nome, count(*) as Quantidade from `livros` inner join `categorias` on `livros`.`categoria_id` =…
-
0
votes1
answer37
viewsProblems to execute query (SELECT with INNER JOIN) that uses data from an HTML form
I have the following code below: public function listarClientesBuscadosDoForm() { try { $c = new Conexao(); $db = $c->conectar(); $query = "SELECT a.cod, a.razao_social, a.cnpj,…
-
0
votes3
answers145
viewsPHP - Mysql remote connection
Good Afternoon! I am setting up a server to host an API, for my connection tests I am using the code below, however I can not make the connection to the database and nor see what error PHP returns.…
-
0
votes1
answer29
viewsJavascript date validation using aaa-mm-dd PHP dates
Fala galera... Next, I need to implement a student’s "Suspend Contract" option. This suspension may only be applied within the term of the student’s contract. Assuming that the student has his…