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
-
1
votes1
answer39
viewsHow to make this condition correctly in Mysql?
I’m wondering which affiliates have repeated enrollment within a company until the exact moment I get to make this query: SELECT DISTINCT filiados.`Filiado_Id`, filiados.`Filiado_MatriculaEmpresa`…
-
1
votes1
answer446
viewsSelect a row where a column has an element of a CSV
I have a table in the database with the following structure: +---------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra |…
-
1
votes1
answer259
viewsHow to create a product relationship with php and Mysql
Some time ago I made an attempt to relate products, but it did not become functional and I believe it was also not the most correct form, I confess, the same is bad, what I did was basically this: I…
-
1
votes2
answers1828
viewsHow to save data from a form automatically?
Hello, good night, I need a help from you, I want to automatically save what is typed in a text area in my mysql database, I’ve heard that has how to do with Ajax, I tried with this code I have…
-
1
votes1
answer464
viewsMysql: Query Table N:N
Create database Banco default character set utf8 default collate utf8_general_ci; use Banco; create table Cadastrados( Nome varchar(50), Sexo enum('M', 'F'), Matricula varchar(9) unique, Curso…
-
1
votes1
answer36
viewsDoubt in Table creation
Good Night, I am creating a database for an association, where it is necessary to do the renewal every semester. I created a registration table with the members data: create table Cadastrados( Nome…
-
1
votes1
answer43
viewsCode is not being read in full
In my Controller file, only the 'Return View' is being read, the following code is passed directly and ends. public function naocadastrado() { return View('/naocadastrado'); $user = new \App\User();…
-
1
votes0
answers775
viewsUpload Mysql Google Chart data
Can someone help me? I can’t load the Mysql data in Google Chart...if I use this same code, but in the graphic "Pie", it works, but in line it doesn’t... it draws the chart but not with data...…
-
1
votes2
answers59
viewsQuery to add fields from two tables
I need a query where I will need to add people by color and race, distinctly, for example, make the sum not only by name, but also by color and race alike. I tried something below, but it’s adding…
-
1
votes2
answers135
viewsSelect in multiple columns with dot in the name does not return result
Each column is composed of names, Fulano, Ciclano, Beltrano etc. I want to select all names that are different. If there is a Joaquin in two columns, you must return one to me. But the problem is…
-
1
votes1
answer154
viewsProblem to open file
When I search a file . txt to import me returns the warnings Warning: fopen(.txt Clients): failed to open stream: No such file or directory in…
-
1
votes2
answers58
viewsBring records that is not in another table
SELECT * FROM quiz WHERE status='publicado' AND NOT quiz.id_quiz IN (SELECT id_quiz FROM quiz_resolvido WHERE quiz_resolvido.id_usuario=1) order by rand() LIMIT 0,10; Today I use this Query to…
-
1
votes3
answers1527
viewsConnect 2 tables with same id
I think my doubt is easy (from beginner). I have 2 tables in mysql: tbl_commission: ID | comissao 1 | 13 2 | 26 tbl_usuario: ID | nome 1 | João 2 | Maria Need to list in table: Nome | Comissão João…
-
1
votes1
answer82
viewsRelational database without referential integrity
I bought a software to make some modifications and implement improvements. However, when I went to evaluate the database, it has no referential integrity, that is, the tables are not interconnected.…
-
1
votes2
answers63
viewsfunction to use query data
I am building a function that via ajax queries a query in the database and via json returns the result. But everything works but I can’t use the json object anywhere else except within the function.…
-
1
votes0
answers73
viewsIncorrect date/time format
In my next code snippet: String horario = evento.getDataOcorrencia().concat(" ").concat(evento.getHoraOcorrencia()); horario = horario.replaceAll("/", "-"); SimpleDateFormat dateFormat = new…
-
1
votes1
answer307
viewsName columns with value returned from Select
I am trying to rename SELECT column with the value returned from another SELECT. Ex: SELECT ID, NOME, QUANTIDADE AS QTDE_4 FROM TESTE Where in QTDE_4, 4 would be the current month. I tried to put…
-
1
votes0
answers101
viewsHow to sort databases alphabetically without accented characters being out of order
I am creating a database in Mysql and want to put some information in alphabetical order. The problem is that when I add the ascending alphabetic order filter, words starting in accented characters…
-
1
votes1
answer461
viewsComment on Mysql table
You can insert a comment in the table equal to the comment in a table field? I need to enter information up to 160 characters in the database tables to help the other devs to have a brief summary of…
-
1
votes2
answers56
viewsError returning reply with search method
I’m having trouble trying to do a search in the bank and return the answer on the screen. This is my main class: public static void main(String[] args) { pessoaDAO ps = new pessoaDAO(); try { Pessoa…
-
1
votes1
answer136
viewsSort string and ASC number
I need to sort a table upwards, but the target column has numbers (1,2,3,4,5 in String format) and letters (P,M,G,GG). How can I do a query that first sorts the strings (G,M,P) in ascending order,…
-
1
votes1
answer28
viewsMysql Pivot Query
I have 3 tables and want to return 1 query making the sum of what was sold. Table 1 = products Table 2 = order Pivot table = order_product How will I bring a listing with the SKU, name and quantity…
-
1
votes1
answer190
viewsHow to put a variable alert in the onclick parameter of a link? using jquery and php
I need to put an unavailable product message on my system, which takes the available status of db (YES or NO) I made an IF that changes the image of the product when the status is NOT but I want a…
-
1
votes0
answers7
viewsProblems updating to MAMP
I have a problem that after I updated MAMP to version 5.7.25 of mysql , when trying to insert a record it simply asks in the correct type, example: I have an ID field where it is integer and…
-
1
votes1
answer44
viewsGroup data from different tables and join in a modal those from the same group
Good afternoon! I’m having a problem on how to think of something effective. I have two tables: budget and budget: Soap Inks Bags All these records have the id_orcamento associated to the table…
-
1
votes2
answers80
viewsHow to Recover Data from a Datepicket Add to Mysql/JPA Database
I am trying to recover the data from a Datepicker in JAVAFX and put in my database, but I cannot convert in a certain way :( // Desse modo dá certo String cpf = cadastro_alunoCPF.getText();…
-
1
votes0
answers148
viewsDoubt on How to pass selected lines from one datagridview to another
good evening.I am developing a Windownsform application with C# and mysql, I have some doubts about how to pass data from one datagridview to another. Datagridviews are found in different forms. I…
-
1
votes0
answers49
viewsDelete database data after 20 minutes
Colleagues. I’m finishing a virtual store, but the customer will work with stocks. The proposal is that after 20 minutes of idleness of this user, the products are automatically excluded from the…
-
1
votes1
answer57
viewsCreate code to update Schema
Use Mysql Workbench to manipulate my Mysql database and tables. When I export the table, it generates a code similar to the code below: CREATE TABLE `entrada` ( `id` int(11) NOT NULL AUTO_INCREMENT,…
mysqlasked 7 years, 7 months ago Italo Rodrigo 4,344 -
1
votes1
answer401
viewsCount record of two date fields grouping by year
I need to get the sum of records of two fields from the same table but grouping the year to assemble an Areachart chart -- -- Table structure cadastros CREATE TABLE IF NOT EXISTS `cadastros` ( `ID`…
-
1
votes1
answer441
viewsChart based on weekly data
Fellow programmers, good evening. I’m having a hard time as build a chart of weekly records using PHP, Mysql and the Highcharts library. I have records of connections and disconnections, which is…
-
1
votes1
answer2437
viewsHow to catch the first and last day of the current month ? PHP
Hello, everybody. I would like to take the first and last day of the current month and store them in two variables to use them in a query condition of a MYSQL query. You know a way to accomplish…
-
1
votes0
answers67
viewsPHP PDO Display a single record
Hello. I have a popup system where the client chooses which one will appear on the home. If one is already selected he cannot select another. You have to uncheck the asset and mark what it wants. I…
-
1
votes1
answer114
viewsInsert Mysql Automatic Data
Boa Noite Amigos, I am looking for a way to register a field for Example Upload that every time a PDF file falls inside a Scanner folder in the FTP hosting it records in the flock this PDF extension…
-
1
votes1
answer62
viewsBring certain record first in SQL query
Hello! All right? I have an image registration system on a portfolio page. In my database I have a table with a column for the image path and a column called main which is a char(1) which can be’S'…
-
1
votes0
answers1170
viewsPhpmyadmin does not open after sena default change
Good afternoon, everyone, After modifying the default Mysql password (In the Xampp interface), it no longer opens and displays the following error message: 1045 - Access denied for user…
-
1
votes2
answers236
viewsPHP+Mysql Search System
I’m a beginner in PHP and I’m having a hard time creating the logic for the search system I’m implementing. I have a GET method form with three inputs and a select and need to mount the SQL variable…
-
1
votes0
answers384
viewsSearch for Zip Code Band
Good afternoon, I need to get a zip code from the zip line registered in the bank... **banco de dados:** cep_id | cidade | cep_de | cep_ate 1 | jau | 10000000 | 15000000 $cep = "15086210"; $stmt =…
-
1
votes1
answer309
viewsAlternative to using view variables in mysql
I need to create a view that gets the percentage of each product in relation to the total of products, I made the query below and this working as a normal select: set @total := (SELECT…
-
1
votes1
answer491
viewsGroup Mysql output in PHP
I have two tables in my database cad_usuario and the cad_automovel. The User registered in the first table may have several vehicles registered in the second table. SELECT aut.usuario_id, aut.marca,…
-
1
votes2
answers406
viewsReturn with json array showing only first record
<?php //database configuration $dbHost = '127.0.0.1'; $dbUsername = 'root'; $dbPassword = ''; $dbName = 'master'; //connect with the database $Mysqli = new…
-
1
votes1
answer23
viewsLink string inserted in a 'sub-category' field to a category
Good night. I have an input 'category', where the user selects the existing categories, and below a field 'subcategory', if the user wishes to register. In Mysql you already have the tables created,…
-
1
votes1
answer147
viewsLaravel user registration 5.4?
I am trying to register a user in the table and is returning the following error: SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select count(*) as…
-
1
votes1
answer179
viewsresize an image and then save to mysql
From a form I want to resize an image only after and then save in mysql, or take an image already saved in mysql and resize it and then update the record. I really appreciate it if someone can help…
-
1
votes1
answer47
viewsCalculation in query in the Database
Guys I have a certain problem if I make an appointment in the comic book, the SELECT makes a calculation of some columns in the database and generates a new field with the name lucro but if there is…
mysqlasked 5 years, 6 months ago Pietro Nunciaroni 157 -
1
votes1
answer130
viewsRecording only the last line in the BD
I am making a form to enter products in stock (NF mirror) for this I am using a Cód in javascript to clone the lines. So far so good, the problem and the time to have register because it only…
-
1
votes2
answers1048
viewsSQL Replace when some variable contains semicolons
I am using this command smoothly to replace class="texto1" for class="texto2": UPDATE tabela SET estilo = REPLACE (estilo,'class="texto1"','class="texto2"') WHERE estilo LIKE 'class="texto1"'; It…
-
1
votes1
answer608
viewsAbout tag for Mysql database
Good morning! Guys! To with database more than 25 thousand records. I’m reformulating the database because it’s very disorganized so I’m building a script to do everything automatic because do 1 by…
-
1
votes1
answer203
viewsSQL select with two or more occurrences of a table in the same row?
In a relational bank terminations have 1 contract, the contract has 1 real estate and two people(landlord and renter) how do I prepare the SELECT to return these two people on the same line? SELECT…
mysqlasked 7 years, 7 months ago Rodrigo A. Santos 189 -
1
votes2
answers1631
viewsForm making empty INSERT in Database
I am creating a simple registration page and created a Form to store what was typed in the Database. However, even with the validation of the Form in PHP to see if there is an empty field, when I…