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
answer40
viewsShould I use prepare in Procedures
Below I have an excerpt of code adapted to illustrate this question: <?php $params = [ ':codUser' => $_SESSION['data-user']['codigo'], ':codCarrinho' => $codCarrinho, ':codPremio' =>…
-
1
votes1
answer187
viewsDifference between normal avg and using case when in Mysql
I have two queries that are supposed to give the same result, however it is not happening. Can someone explain to me why it is not displayed even result? Query that returns me the expected result:…
-
1
votes1
answer43
viewsMYSQL - Query summing 8 identical tables
Good afternoon, I am very new in MYSQL, basically I am learning in network searches, but a question arose that I could not solve. I have about 6 tables, in each I have 10 fixed and identical entries…
-
1
votes1
answer45
viewsHow to make a LINQ query that returns the amount of people who were born per month?
I would like to make a LINQ query that returns the amount of people who were born in the month. In Mysql I do this query: SELECT COUNT(*) AS DataNacimento FROM pessoas WHERE MONTH (DataNascimento) =…
-
1
votes1
answer526
viewsSelect case in two tables
I have 4 tables: Saida{ id int, idDestino int, idProduto int, tipoDestino int, quant int, data date, solicitante varchar} Paciente{ id int, nome varchar} Unidade{ id int, nome varchar} Produto{ id…
-
1
votes1
answer96
viewsSort records containing numbers at the end
I have a table with the following records: +----+------------+--------------+ | id | title | url | +----+------------+--------------+ | 1 | Olá Mundo! | ola-mundo-1 | | 5 | Olá Mundo! | ola-mundo-3…
-
1
votes1
answer1651
views"No database Selected" in PHP with Mysql
Columns to receive data: $GravaLinhaBanco = "INSERT INTO `trechosmonitora_cotacao` (`Codigo`, `CodTrecho`, `CodCliente`, `CodLoja`, `Url`, `Rotulo`, `Trecho`, "; $GravaLinhaBanco = $GravaLinhaBanco…
-
1
votes2
answers57
viewsHow to make a select that returns the expected result
Hello, I have 3 tables in Mysql Categorias,VideoContemCategoria and Videos I’m trying to make a select where I return all categories and together with each category return the last video that was…
-
1
votes1
answer50
viewsReturn more than one variable in Jquery/PHP
Being objective, my problem is this: I have a form in PHP/HTML and I am using a self-paced field via Jquery. This form brings the last numbers wagered by the user and redoes the bet with this…
-
1
votes3
answers207
viewsUnsigned in the primary key increases my chances?
I was setting up a bank for a personal project and I came across creating a table to keep a few values, this would use a TINYINT as a primary key, since I assume I won’t go more than 100 records,…
-
1
votes1
answer29
viewsProblems picking up data in previous record - Mysql
I have this query that returns the last record and the previous one: SELECT Colaborador FROM centrodb.Registolistagem LEFT OUTER JOIN centrodb.Registolistagem2 ON centrodb.Registolistagem2.IdLista =…
-
1
votes2
answers3562
viewsHow to connect to Xampp Mysql from another server with Linux installed?
Hello I have a test server known as Xampp in it I have an active database in mysql, only I also have another server with apache running on another machine, and it is in this machine that I want to…
-
1
votes1
answer72
viewsSELECT in auto-relational table
I have a table funcionario, with attributes: ID(PK) and IDCHEFE (FK from the table itself). Each employee(a) has one idchefe which refers to another official (who is his boss(a)). How to make a…
-
1
votes2
answers789
viewsTake the largest value from a Mysql column
I have a column where you store the values: Nome | Turma | Nota1 | Nota2 | Nota3 | Nota4 How would I get the highest score of the Nota1, Nota2, Nota3 and Nota4 fields? I understand that MAX() does…
mysqlasked 5 years, 11 months ago user24136 -
1
votes1
answer706
viewsPopular a select generated by javascript
I am copying fields from a form with javascript, but in this form two input sane select and the option are generated from the result of a query. When copies are created query do not rotate and…
-
1
votes1
answer507
viewsString binding of SQL tables instead of id
Data from user accounts id nome sobrenome pais estado cidade telefone url_perfil Login data of users id email senha prioridade My doubts are: How can I link them to foreign key using string ? It is…
-
1
votes1
answer35
viewsDoubt to level array after consulting SQL with Eloquent
Hey, guys, I put together the following code: $concat = array(); $products_categories = array(); $departament = $request->getParsedBodyParam('departamento'); $categories =…
-
1
votes1
answer67
viewscalculate duration between 2 values within the input
Hello, I have a javascript code that helps me calculate the duration between one hour and another, I need to know how to make these values more dynamic, I want to put the input time in an input, the…
-
1
votes1
answer74
viewsStock Control Grouping Products of the same type
I am producing a stock control system, but the stock needs to have a product grouping system with the same SKU, example, I have a product called "T-shirt A", but there are several types of "T-shirts…
-
1
votes1
answer603
viewsretrieve all records from the last 12 months including zero
I have my table bud_quotations and I want to retrieve all the records that have been entered in the last 12 months, including the months that have no record. Now the count is not working, always…
-
1
votes1
answer301
viewsMysql structure in firebase/firestore
How to create a collection 1:1 and 1:n in firebase, as in the images, where I have company tables, city and categories, as would the relationship between them in the firestore, mainly the relation 1…
-
1
votes3
answers815
viewsHow to change page content according to the end inserted in the link (URL)?
I have a user registration system. The person inserts some information such as user, photo, name, a brief personal presentation, phone, and email. Automatically an id is generated for each new…
-
1
votes2
answers120
viewsSum of values taking into account 3 table fields
I have the following table quotations that serves to fetch the totals of various budgets. And each budget has one piece (part_id) which can have several:…
-
1
votes2
answers62
viewsMYSQL: sort by specific Rows within SELECT
I’ve been trying to figure this out for three days and I haven’t found the answer anywhere I have a table in the database where I need to do a SELECT on all products but they need to be sorted…
-
1
votes1
answer317
viewsSQL counting data from the second table of INNER JOIN, but shouldn’t?
I have 2 tables: sponsors quotas What I need to do is check how many nominees the sponsors have but only count the users who have the record in the table cotas. The SQL I made is as follows: SELECT…
-
1
votes3
answers254
viewsHow to concatenate a varchar into a Mysql function?
I have this hypothetical function: BEGIN DECLARE dado VARCHAR(150); SET dado = 'teste'; END; How do I concatenate the variable dado, as an example: SET dado += ' teste2'; I tried this but it doesn’t…
mysqlasked 5 years, 10 months ago Rafael Silva 944 -
1
votes1
answer783
viewsReal-time data filter using Jquery
I am building a comment system and I would like when the user selects the value of a select field, a variable is sent to a PHP page with the selected value, and the same returns the results within a…
-
1
votes0
answers110
viewsHow do I open an email link when logging in?
I am sending a link to a user, but as he is not logged in he directs to the login page, only when he puts user and password he goes to the main page of the php system, how do I make so that when…
-
1
votes1
answer43
viewsAlternatives to using transactions on Myisam
I have an application that is in a hosting that does not support me the storage mechanism Innodb, therefore, I am at the mercy of the use of Myisam. There is a secure alternative to using…
-
1
votes2
answers511
viewsBring only the first occurrence of a regex
How to search in a query only the first date? For example: 30/09/2018 and 14/10/2018 and 21/10/2018 I would like to bring only the first date. I am using so, [0-9]{2}/[0-9]{2}/[0-9]{4}, but it…
-
1
votes0
answers97
viewsHow to sort values with too many characters?
good afternoon I’m doing a query that fetches values that return like this: TEST-1 TEST-2 TEST-3 TEST-4 TEST-5 TEST-10 TEST-11 but when it reaches 10 it orders by the first character for example:…
-
1
votes2
answers1019
viewsPDO Statement Dúvidas
I wonder if when I use the queries for SQL commands with PDO I need to use bind(): $SQL->bindValue(1, $email, PDO::PARAM_STR); // Seria algo assim? For example in this case: $searchSQL =…
-
1
votes1
answer128
viewsDo I want to show the birthday boy two days before or after the event?
I have a consultation that shows on the system Dashboard the birthdays of the week, all who make birthdays between Sunday and Saturday are displayed on the screen, but it is very annoying to watch…
-
1
votes1
answer703
viewsSearch last record of a distinct group
I’m developing a small vaccine control system and I’m having a hard time executing a select. I have a record of dogs, other types of vaccines and a third of dog vaccine, where I group the dog’s id,…
-
1
votes1
answer438
viewsYou have an error in your SQL syntax
I am learning php and I am trying to make a combobox, it is pulling the database data correctly but when displaying the result presents this error: You have an error in your SQL syntax; check the…
-
1
votes1
answer294
viewsHow to list and delete Variables in Mysql?
I know it’s a very basic question, but I can’t get a straight answer on the Internet. I wonder how to list and delete variables in Mysql. Ever since I thank.
-
1
votes2
answers94
viewsPHP site does not read special characters
The Site they sent me (I am an intern) is in trouble because it is not reading the special characters. I’ve noticed the famous charset UTF-8, but when I went to look at the databank, the collation…
-
1
votes0
answers31
viewsSave/Change input from same Ids
Good afternoon, you guys. I have a question about recording several inputs with the same id in Mysql, I have already searched several pages and I haven’t been able to find a solution for how to do…
-
1
votes0
answers101
viewsReplace a name in all mysql database tables
Good morning. I need to replace a domain that is in several tables of the comic. That would be the correct form? SELECT REPLACE('*', 'velho.dominio.com', 'novo.dominio.com'); As there are many…
-
1
votes1
answer133
viewsTaking data from a PHP DOM site
Hello, I’m trying to get data from a website to an internal system I’m creating through PHP I’m using the DOM for this. I was able to find all the information in his html, but I’m not able to…
-
1
votes1
answer842
viewsFatal Error: Uncaught Error: Call to Undefined Function getList()
I need to reuse this function so that it uses fetchAll but also use num_rows, the problem is that if I return fetchAll or num_rows it works, but in that case I would have to create two functions…
-
1
votes2
answers122
viewslistbox with database records
With this code I create an item in the listbox with the id number, I would like it to create an item for each id record you have in the database. Database: Mysql Code: UWP C# using (_connection =…
-
1
votes1
answer56
viewslistbox item (UWP)
With this code I add items to listbosx with the amount of record I have. How to have a check before to know if the entry of that record has been added and not act item with the same id number?…
-
1
votes0
answers29
viewsHow to assign a "Code" Product to the User Request
So guys I’m modeling a database in Mysql that has 4 tables USERS REQUESTS PRODUCTS STOCKPILE A PEDIDO who owns ID_USUARIO, ID_PRODUTO and STATUS, and when the request is made he will have the ESTADO…
-
1
votes1
answer35
viewsData in listview (uwp)
how to display the information of a Mysql database record in a listview? I tried it but it didn’t work. using (_connection = new MySql.Data.MySqlClient.MySqlConnection("Database=teste; Data…
-
1
votes1
answer482
viewsForm, PHP and MYSQL - mysqli_num_rows always equal to zero
Fellas, I’m doing a pro bono job for a public service, and I’ve been trying for days to figure out what’s wrong with my code. If anyone can help me, I really appreciate it. O formulário é esse:…
-
1
votes1
answer206
viewsHow to use mysql zerofill in Laravel Migrations?
I’m trying to add the zerofill of MySQL in the Migrations of Laravel but I’m not succeeding. Can you tell me how to do this ? Follow my sample code by editing a table by adding this tinyint field…
-
1
votes1
answer56
viewsHow to improve QUERY
As I could improve this query, it returns me 30 records from a table that contains 43thousand records. NOTE: I use index in the core column (much improved). ((SELECT id,situation,info FROM request…
-
1
votes1
answer326
viewsSelect bestsellers in related table
I have a table pedidos, produtos and another produtos_em_pedidos described as follows: produtos: id | nome pedidos: id | data produtos_em_pedidos: produto_id | pedido_id | quantidade I need to…
-
1
votes1
answer82
viewsTitle with PHP variable
Hi, I developed a page php details. which uses the get method to take the information of the dice and play on the page. And put a variable $name within the HTML title <title><?php echo…