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
-
3
votes1
answer1020
viewsMysql connection does not appear in Data Connection
I updated my Visual Studio to 2017 version and am trying to connect to a Mysql database through Entity Framework. What happens is that the option for connection in Mysql does not appear: Only SQL…
-
3
votes1
answer81
viewsWhy create a table in Mysql?
I’m learning to work with Mysql and I’m seeing some examples of how to work with more than one table, as an example below: Id Nome Faculdade_id 101 Amanda 11 102 Bianca 12 103 Carla 13 104 Daniela…
-
3
votes2
answers4388
viewsError creating table: Invalid default value for
I went to create a table in the bank and appeared following error: Invalid default value for "updated_at" Here is the table to create: CREATE TABLE `user` ( `id` INT( 11 ) NOT NULL , `uuid` CHAR( 12…
-
3
votes2
answers172
viewsIs it worth 'shuffle' ID that will be passed via URL?
We were talking about database security. Came the question: worth encrypting Ids coming from the database to the frontend? E.g.: I click on a client from a list where the link goes…
-
3
votes1
answer142
viewsList last logged in users (GROUP BY AND ORDER BY)
I have two tables (user and log), and would like to list users ordering by last logged in. I am using the GROUP BY to join the logs (since a user may own more than one). The problem occurs when I…
-
3
votes1
answer922
viewsWhy is it not possible to use an "alias" in the WHERE clause in Mysql?
I need to wear a alias in the clause WHERE, but keeps telling me it’s an "unknown column". I need to select records that have a higher rating than X. The rating is calculated as the following alias:…
-
3
votes2
answers2495
viewsHow do I sort the list alphabetically in the Standard?
I have a query that lists me several users I want to sort these users by alphabetical order as I can do ? php private function getChilds(array $elements, $parentId = 0) { $branch = array(); foreach…
-
3
votes3
answers363
viewsProblem with Between in Mysql?
In an input and output control system there is a table cad_entrada_saida where it has two columns in the bank dEntrada and dSaida, these two columns are like varchar and recording the data in the…
-
3
votes3
answers200
viewsList columns according to current date
I have the following view: select * from chamdosrow It returns as follows: NOME 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31…
-
3
votes1
answer88
viewsIs there any SVN for database?
I have the following environment, an online database (Mysql) for production and several others (copies for each developer) used for local testing. Is there any program as well as SVN that performs…
-
3
votes0
answers119
viewsLogin function
Good afternoon I had a problem with my login script, it informs that the email does not exist in the bank, the problem I have always done this way, and now I have no idea what I did wrong Login…
-
3
votes1
answer188
viewsDoubt Inner Join, left Join mysql
I am working with the following tables: CREATE TABLE livro ( Id_livro int NOT NULL, Nome_livro CHAR(40) NOT NULL, Pg int, Edicao int, Editora int NOT NULL, Assunto int NOT NULL, Preco decimal (5,2)…
-
3
votes2
answers107
viewsList Birthday Kids of the Day Using Laravel
I use the code below that gives me a list of birthdays per month, but would need for the current date. Example: today 09/04 and the list display. $aniversariantesDoMes =…
-
3
votes1
answer43
viewsVisible index or not?
About using the parameter Visible of index of a table, I would like to know: What is the effect of this parameter on a table field? This parameter is specific to Mysql or found in other BD? Will…
-
3
votes0
answers47
viewsWhat are the cardinalities of the Indians?
Checking the Index using the following command: show indexes from tabela_exemplo; The column Cardinality left me in doubt. It holds an integer value for each index pointed to one or more columns…
-
3
votes1
answer96
viewsBring results from two tables (INNER JOIN error)
I have the table secretariats with the following structure: And the worker table with the following structure: I related the worker table to the secretariats table through the following list: That…
-
3
votes0
answers37
viewsRefresh in a <li>
I have a content inside a <li> I need to refresh her at the event onclick. But within this li there is a function in php. How would that be possible?…
-
3
votes1
answer375
viewsASP.Net MVC application with Jquery Bootgrid does not load data
I created a very simple application (customer registration) using ASP.Net MVC 5 + Entityframework 6 (codefirst) + Mysql database. Using as main component the Jquery Bootgrid for data handling. It…
-
3
votes1
answer90
viewsMerge different database queries
"It is possible to join information from tables of other databases?" This doubt arose when I needed to do a survey make a comparison of data in tables of different stores, Every store has its own…
-
3
votes1
answer95
viewsSELECT Union ALL Disregard Arguments
I have This query that sums two results in different tables. SELECT sum(g) saldo_anterior from ( SELECT SUM(valor_pg) g FROM ctrl_deposito WHERE MONTH(data_pg) < 11 and YEAR(data_pg) <= 2016…
-
3
votes2
answers99
viewsGroup by mysql adding null values
How can I add empty values in group by? Example: I have an appointment that is organized by ages: CASE WHEN TIMESTAMPDIFF(YEAR, STR_TO_DATE(DataNascimento, '%d/%m/%Y'),CURDATE()) < 4 THEN 'Menos…
-
3
votes2
answers433
viewsCheck if email is registered in the BD
I’m doing a search in my BD to verify the existence of email, avoiding the registration of the same again, but I’m having problem in return, the script below sends and treats the return. if…
-
3
votes2
answers1041
viewsHow to check if a date is already in the correct php format?
I’m picking up a date in form and in firefox the DATE field behaves like a normal text field. Ai, if the person type a date in the format dd/mm/yyyy, I have a function that converts this date to…
-
3
votes3
answers559
viewsDocument protocol
I am making a program in php, mysql and would like to generate a protocol with some argument. The protocol would be generated automatically in the system, without interference from the user, but it…
-
3
votes2
answers9900
viewsDisable "sql-mode=only_full_group_by" option
I installed mysql in my note and am using Linux Mint 18.2. When I run the query: SELECT *,SUM(ValorTotalProdutos) AS ValorTotal, SUM(QtdProdutos) AS QtdFinal FROM tabela WHERE SESSIONID =…
mysqlasked 7 years, 3 months ago user24136 -
3
votes2
answers932
viewsGROUP BY SQL error
I have the following exercise: List the department code and name, newest and oldest admission date of each department, sort by department name. Here’s what I did: select d.department_id,…
-
3
votes1
answer44
viewsI cannot remove an item from the database
I’m trying to remove an item from the database, but I’m not removing it. <form action="removelicita.php" method="post"> <input type="hidden" name="id"…
-
3
votes2
answers362
viewsRemove line break after each INSERT
I own a textarea in my code, where the user will insert access vouchers separated by ENTER. My PHP code treats the typed values as follows: $voucher = explode("\n",$voucher); foreach ($voucher as…
-
3
votes2
answers244
views -
3
votes1
answer487
viewsValidate data with PDO
I am migrating my php code in which I was using sql query to PDO, but I am finding it difficult to validate data with this. NOTE:I already have a functional file that does the search in the…
-
3
votes1
answer790
viewsCheck whether the field is null in java and mysql
How do I check if a database field is filled or null? Do you have a Resultset method that does this check? In this case it is a date field. PreparedStatement ps = connection.prepareStatement("SELECT…
-
3
votes1
answer1077
viewsLogin with permission levels
I have a login system that, if the user is an administrator, will be redirected to one page and if common, to another. That column ativo is what defines whether a user is admin(1) or not(0).…
-
3
votes2
answers944
viewsMenu, submenus Dynamic NAV Bootstrap with PHP PDO Mysql
Good night. I need to assemble a dynamic menu, of three tables, that need to be interconnected, but I’m lost. Follow a part of the organization chart below: At the moment, I have the following code:…
-
3
votes2
answers946
viewsEncryption with bcrypt + random salt
I have a simple question about encryption using bcrypt with salt. When in old projects I used md5, to check in a login form if the user typed the correct password and authenticate, it was customary…
-
3
votes2
answers257
viewsHow to show the data repeated only once?
Well, I have the following problem in Mysql: I created two tables a table of books and another table of authors. Well, I need to show the name of the book with their respective authors, but have…
mysqlasked 7 years, 1 month ago Adri Silva 71 -
3
votes2
answers58
viewsReturning linked data
With the help of Milrak Pereira Pessoa and Wéllingthon M. de Souza, I edited my code... I have a product code and it has 5 types and 5 descriptions. I am trying to bring to the user the types and…
-
3
votes2
answers566
viewsSelect values that are not in another table
My scenario is as follows: Table Fila I have the Activity table I need to mount a select, taking the values from the row table, however I need to exclude from the row the values that already exist…
-
3
votes1
answer51
viewsE-mail is not being true
I have a problem: I’m creating a field "forgot password", where the user enters the email and if it is in the database appears as true and redirects to the page teste.php; otherwise for the page…
-
3
votes3
answers68
viewsHow is Join and WHERE made with multiple tables?
I have 4 tables they are already with Foreign key. aluno: id matricula username curso_id // referencia a id_cursos da tabela cursos, coluna id_cursos. cursos: id_cursos nome_cursos modulos:…
-
3
votes1
answer577
viewsHow can I add data to another column with the result of another column?
I have the following scenario and need to add the result of a Select in another column of the same table, for example, a column with the numbers and another to check how often these numbers appear:…
mysqlasked 7 years ago Luann Rodrigo 39 -
3
votes1
answer735
views -
3
votes1
answer523
viewsReplication of a database
I have read some articles on database replication and mirroring, but a doubt I still have, and I did not find a "concrete" answer would refer and update the database. For example: I have MASTER and…
-
3
votes2
answers1622
viewsTry/Catch Pdoexception does not work when error occurs
I created the following method to execute my querys: public function setQuery($query) { try { $stmt = self::$conn->prepare($this->limpaQuery($query)); return $stmt->execute(); } catch…
-
3
votes1
answer511
viewsFailed to register NULL value in database - PHP7
Good night to you all, I am a beginner and I am developing a registration system for CATEGORIES and SUBCATEGORIES in PHP7 and MYSQL; The logic I used to register Categories and Subcategories is:…
-
3
votes2
answers480
viewshow to make a mysql query that contains multiple id separated by comma
good afternoon, how can I make an appointment where I have in my field idProduto several ids of product separated by comma and list each of its respective. example: in my idProduto I have the ids…
-
3
votes1
answer4020
viewsError: Mysql returns the following "Subquery Return more than one Row"
Good morning! I created this query in mysql and by adding the 1st subquery I called "totalEscolas" I get the following error: "Subquery Return more than one Row" without this subquery the code works…
-
3
votes1
answer1275
viewsPrint table with ajax and php
I’m trying to print a table using php, ajax and mysql. I have this excerpt in Html <!DOCTYPE html> <html> <head> <title>Teste Ajax</title> <?php…
-
3
votes1
answer55
viewsI need to add values from a table
I own a SELECT and in it I display the sum of the sales values of each product, I would like to make a total sum of the table that made the sum ? SELECT cadpro.descricao, sum(itensped.total_venda)…
-
3
votes2
answers868
viewsWhen trying to define column as Unique, error is generated by talking 767 bytes
When I try to run a Migration on Laravel, the following error is generated: [Illuminate Database Queryexception] SQLSTATE[HY000]: General error: 1709 Index column size Too large. The Maximum column…
-
3
votes1
answer77
viewsPlay button plays another audio
I call a table posts, and in it is a column post_aud where a text with the audio/music name is 'inserted' (which is 'saved' in the Audios folder)... $get_posts = "SELECT * FROM posts ORDER by 1…