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
answer50
viewsMount Mysql query in Laravel
Gentlemen, I have the following query in mysql SELECT DATE_FORMAT(created_at, '%Y') as 'year', DATE_FORMAT(created_at, '%m') as 'month', COUNT(id) as 'total' FROM emprestimos GROUP BY…
-
0
votes1
answer410
viewsMysql, use SUM(total) > 10 quantity in WHERE
I have the following MYSQL query: SELECT SUM(A.val) AS totalvendas, B.cod AS codigo, B.nom AS Nome, B.reg AS regiao FROM venda AS A LEFT JOIN vendedor AS B ON A.ven = B.cod WHERE reg = "norte" GROUP…
-
0
votes2
answers484
viewsIncorrect syntax error next to engine
I would like you to help me. The following error is appearing: MESSAGE 102, LEVEL 15, STATUS 1, LINE 17-INCORRECT SYNTAX NEXT TO ENGINE but I couldn’t find him. CREATE TABLE SITE ( SITE_ID INT…
-
0
votes2
answers99
viewsTrigger for table optimization
I’m trying to create a trigger which rotates the control OPTIMIZE mysql. In short, I have an A table and created a B table that will save a datetime where this value will be updated every time the…
-
0
votes0
answers84
viewsError message when creating new Controller with Entity Framework
I’m new to the ASP.NET MVC and I’m having a problem. When I try to add a new Controller using Entity Framework gives an error saying: error when running the selected code generator: value -1 is out…
-
0
votes1
answer292
viewsUse of Lastinsertid() more than once
I need to use lastInsertId() more than once in my application. Follow an example of such an event: <?php //CONEXÃO COM O BANCO DE DADOS $pdo=new…
-
0
votes1
answer1165
viewsDraw system
I am intending to make a draw system on my website. I read some questions (including one that I liked very much that was this one) and I noticed people saying that X Cities could never be drawn,…
-
0
votes1
answer141
viewsError BD query (Codeigniter PHP Mysql)
Someone could help with this mistake? In BD I have the table Cities and I’m trying to list cities, I’ve made several changes and it doesn’t work. When listing cities I will improve the query, I have…
-
0
votes0
answers31
viewsInsert Select as a mysql database parameter
I have a mysql database that receives some parameters, I would like to know how to pass as parameter a query. Ex.: CALL sp_DisciplinaSave(SELECT ec.nome, ec.codigo, '' as sEmenta,'' as…
-
0
votes2
answers635
viewsBreaking lines in text from the database
I intend to load the page, the text coming from the bank, with the paragraphs and line breaks, just as it is in the bank. Below goes what I’ve tried: View.blade.php <div> <p…
-
0
votes0
answers154
viewsRank system higher to lower order
As the title says I’m having trouble putting a rank system from higher to lower number. My system is in the order of the database order in the database = 10,9,6,8,2,3 <- is in the order msm on my…
-
0
votes0
answers88
viewsHow to separate the result of a mysql query into clusters
AS TABLES: -- -- Estrutura da tabela `tb_inc` -- CREATE TABLE `tb_inc` ( `idinc` int(255) NOT NULL, `codi` varchar(255) NOT NULL, `origi` varchar(255) NOT NULL, `nomei` varchar(255) NOT NULL,…
-
0
votes1
answer56
viewsSeparate string data from a table into other tables
Good morning, I have a table called TP_SAN_SRV, which is the table that has the blood type and blood factor, but I need to separate them in two, where the blood type and blood factor are separated.…
-
0
votes1
answer52
viewsVector sum doubt and bank recording
I have this simple form <form> <div class="itenspedido"> <h4>Itens do Pedido</h4> <div id="itens"> <div class="div-bloco-form"> <label…
-
0
votes1
answer929
viewsCall to a Member Function fetch_object() on a non-object
In the following code, the following error occurs, which I cannot understand why: Call to a Member Function fetch_object() on a non-object at line 21 <?php require('config.php'); if…
-
0
votes0
answers37
viewsunset() being executed within a wrong parole
I have an interesting problem: my unset($_SESSION['x']) is running inside an IF that is not true. See my code: <?php // Codigo do estado $cod_estado = $_GET['s']; // Função da classe Usuario…
-
0
votes0
answers28
viewsError while calculating fields in IOS safari
I have a problem in the development of a small calculation system where the user needs to put a value in a field and the system brings the results according to a specific account. In all windows…
-
0
votes1
answer402
viewscreate Trigger mysql
I have two tables: the requested table and the logs table. Users can interact with the requested table, link a php script that runs a query update and update the status column. I need to create a…
-
0
votes1
answer60
viewsHow to make mysql select pick up data with a list restriction?
Good afternoon guys, in mysql select has the option IN(), which passes a string list, then it filters that list in select in Where, ex : SELECT * FROM tabela WHERE id IN (1,2,3,4) Is there a…
-
0
votes1
answer79
viewsSearch time in mysql
Colleagues, I have a system that is storing the time of registration of users in the following format in the Mysql database: 11:11:00 ( the time may be any other as per the user’s registration ) But…
mysqlasked 7 years, 11 months ago user24136 -
0
votes2
answers1147
viewsEdit Mysql database with php
I’m making a registration system in php, and using mysql as db, I’ve been able to make the registration page and it’s working normally. The problem is that now I need that when the registration is…
-
0
votes2
answers69
viewsHow to show only the records exactly the same as those typed?
I have this code that shows all records as long as the initial number or letter is the same, but I wanted to show only the records that are exactly the same as those typed in the search field, or…
-
0
votes1
answer28
viewsShow quotes coming from Mysql
In Mysql I have a table with the following data: “Cavalo dado não se olha os dentes”, disse a professora <br> Segunda linha I’m taking this field like this: $sql = $pdo->prepare('SELECT…
-
0
votes1
answer674
viewsProblem with Insert using mysql_query()
I’m working on an old system, in which makes the connection to the bank still with mysql_query. I used very little mysql_query and the last time I used it a long time ago, I’m more used to PDO. I’m…
-
0
votes3
answers353
viewsAverage time in seconds
Hello, in my select I need to find the average service time (TMA) between two columns BIGINT format being them: Date: Dtbegin (start) and Dtend (end) They are of the format "dd/mm/yyyyyy hh:mm:ss",…
-
0
votes2
answers63
viewsReturn Mysql result as ranking
As I should do in this query, where I have a user register, and each user sends several photos to another table, each photo sent receives a score of 1 to 5 I need to bring the 10 with the highest…
-
0
votes1
answer31
viewsHow to exclude a data from one or more tables
I have an id that appears in several tables but, I need to delete it in the main page and delete it in all other tables as well. ex : DELETE FROM admissao_dominio.*, admissao.*, bancarios.*,…
-
0
votes0
answers510
viewsMysql does not start on the server!
I am unable to start Mysql on the server console. Follows log of Mysql error below: /*************** /var/log/mysql/error.log ***************/ 170525 10:50:35 [Warning] Using Unique option prefix…
-
0
votes1
answer640
viewsMYSQL+PHP, How to add items from different tables SUM()?
I have two tables: table_entries | id | descricao | quantidade | | 1 | Maquina Prensa | 1 | | 2 | Maquina Secadora | 2 | table_bom_entries | id | id_itens | codigo | quantidade | | 1 | 1 | mp001 | 1…
-
0
votes2
answers203
viewsHow to get the exact date and time after updating a record?
Whenever I update user data, returns me the wrong time, for example: I updated the user profile at 16:41, but in my database it appears like this 2019-10-15 16:10:53 I’m using mysql along with…
-
0
votes1
answer46
viewsProblem sending PHP to Mysql
Good night. I have a big problem and I can’t fix it. I created a form to register and when I click send, instead of sending, appears the PHP code. I already installed XAMPP and then WAMPP, but it…
-
0
votes1
answer106
viewsTIMEDIFF with period exception (Business hours)
Hello, I have an SQL query that returns the time difference between 2 dates, but I need to calculate this difference by adding a period (08:00 - 18:00) for example: Start date: 2019-10-18 15:00:00…
-
0
votes1
answer7521
viewsHow to query in Mysql and PHP database
I made a registration form that adds the information in the Mysql database. But I created a query form and would like to know how to return information from the database. Insert.php <?php…
-
0
votes1
answer33
viewsSQL: JOIN and Count Repeated Number
I need to join Table Client along with the Table Request and would like to compare the Client id. the client ID of the Client table, Along with what’s inside the order table in case the column…
-
0
votes2
answers95
viewsWoocommerce show products featured by sql category
would like this result to be just 1 with all formations separated by column and that it only appears if there is name = 'Resin' AND name = 'featured' otherwise do not list sql if I put WHERE b.name…
-
0
votes1
answer515
viewsView Mysql inside modal
I am developing a new PHP ordering system that works as follows: The user does upload requests, which are stored in a Mysql table called requests; After uploading, the user can change the status of…
-
0
votes0
answers132
viewsQuery returns empty when executed in Laravel
I am running the following SQL: select * from `table` where `fields` = PointFromText("POINT(-23.559762 -46.699425)") When executed directly by the bank returns the id expected to be executed by…
-
0
votes1
answer23
viewsIs it possible to know the Column selected by GREATEST in Mysql?
Hypothetically, having 8 columns in an X table, 4 of these columns store an average: AVG(colunaN) And the other four store the amount of elements of that average COUNT(column) In a query I’m trying…
-
0
votes1
answer878
viewsDelete in sql - Inner Join
As is the syntax of a query using Inner Join delete in sql, to compare two table code and exclude being equal? Table itemVenda. in table itemvenda a sale was registered whose code is 4. To execute…
-
0
votes0
answers28
viewsPHP Language Comparison
I need to compare products in the table if the language esp and ing are filled... When I register the product it registers as the language 1(by). Then the customer has to register the 2(ing) and…
-
0
votes2
answers404
viewsProblem in Insert shows no error
Everyone all right? I’ve searched the entire forum and even other forums and couldn’t find answers on this. If anyone can take a look and point out my mistake I’d appreciate. Follow the form:…
-
0
votes1
answer61
viewsSearch set of records by date
I am currently creating a Java/Mysql Desktop program. When inserting into the bank, the table is very simple: id - dataInserido - códigoProduto - qtd I would like, through an SQL, to group in…
-
0
votes2
answers226
viewsINNER JOIN Mysql error and JSON view
Hello I need to display the results of a SELECT with INNER JOIN in JSON format, my query is working, because I tested inside PHPMYADMIN, but my page does not work, I have tested everything, what can…
-
0
votes1
answer70
viewsBug when doing INSERT in database with PHP and Mysql
I have an INSERT script that even not selecting any image within another input, in the database saves the name of the image formatted by the Rand function but without any extension, instead of being…
-
0
votes1
answer96
viewsMysql Trigger syntax error
I tried to create the Trigger below in phpMyAdmin, but returns the following error: Messages from Mysql : 1064 - You have a syntax error in your SQL next to '' on line 4 Someone’s been through it or…
-
0
votes1
answer97
viewsError when trying to fetch HTML form Mysql BD information
I am trying to make a search through information passed by the user. However, when I click send, gives an error. Follow my Form code and PHP code. 1)HTML <!DOCTYPE html> <html>…
-
0
votes3
answers367
viewsSearch field with php and mysql. How not to differentiate special characters?
I’m having a problem with a search field on a php site with Mysql database. I have a record in the bank as "SIPHON" and when I search as siphon, siphon or SIPAO does not return this record. I wish…
-
0
votes1
answer41
viewsError starting Mysql in WSL
Hello, am having a problem starting Mysql 5.7 on WSL with Ubuntu 18.04. when trying to start the service with: $ sudo service mysql start $ * Starting MySQL database server mysqld -su: 23: .: Can't…
-
0
votes2
answers119
viewsLIMIT IN A QUERY IN A FIELD
I have a table where there are two fields with possible values: yes-no. The select I’m doing is this: select nome, media, escola as 'Particular', bairro as 'COTA DE BAIRRO' from alunos where curso =…
-
0
votes1
answer59
viewsHelp to display database data on the screen
I am doing an INNER JOIN between two tables of my bank. But I’m having trouble showing the organized result on the screen, could someone help me? The tables are of category and service (related to…