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
answer699
viewsmysql error: 1054. Unknown column'mover_almox.cod_promob 'in 'Where clause' even if I am not using this column in the parameters
I am trying to make an Insert in my database with the following command: UPDATE movimentacao_almox SET quantidade = 100, qtd_pendente = 2 WHERE id = 1113; but I get this mistake: Error Code: 1054.…
-
1
votes1
answer65
viewsConditions in Query SQL
Hello, I would need a help, I would like to bring only the employee who does not have the word NR-35 in the table/column functionalscursospd/pdf, my problem is that I have more than one course…
mysqlasked 4 years, 10 months ago user144273 -
1
votes2
answers541
viewsHow to separate string in array?
I have a column descri_produto which would be the product description. The problem is that I am not able to separate the description in array. $cat = $_POST['categoria']; $sql= "SELECT DISTINCT…
-
1
votes1
answer293
viewsSend an ALERT to a UNIQUE field in Mysql
I have a field in the BD set as Unique, to avoid duplicate registration. Works perfectly. I wonder if there is a way to personalize this message, with an Alert, for example. My code: <?php…
-
1
votes0
answers28
viewsIs it possible to convert Excel to Mysql?
good evening guys, I wonder if there is the possibility to export an Excel spreadsheet to Mysql?
mysqlasked 4 years, 10 months ago Ronaldo Fortes 11 -
1
votes1
answer188
viewsComplete fields with select
I am with a problem, that I can no longer solve, I am trying to fill the fields from an option that is contained within a select which is filled automatically with the foreach, but it’s not working…
-
1
votes0
answers22
viewsImport CSV to Mysql
I am creating a table in Mysql, in it I will import daily several CSV files with different names. When importing I need the file name to turn a column in the table. Teste1.csv: 111111;HONORIO;20…
-
1
votes2
answers325
viewsGetsqlvaluestring / mysqli_real_escape_string / Notice: Undefined variable: mysqli
I am trying to convert a function to Mysqli, to use with PHP7.1. I am having difficulties with mysqli_real_escape_string, and mysqli_escape_string. Error: Notice: Undefined variable: mysqli in…
-
1
votes1
answer476
viewsUPDATE with AJAX
I am doing an AJAX which, after the user select a checkbox and set a status (the status is select) AJAX take the information and send to a page called status.php where the status change box,…
-
1
votes1
answer614
viewsGet PK from one table and Insert as FK into another
I have an inheritance in my work and I’m struggling to make it work. Example of the Tables CREATE TABLE IF NOT EXISTS pessoa ( idpessoa INT NOT NULL AUTO_INCREMENT, tipopessoa VARCHAR(45) NOT NULL,…
-
1
votes3
answers49
viewsError query by date
In my application I have a query by date, below is an excerpt from the script tblacesso.HorarioSaida BETWEEN '2017-06-17 00:00:00' AND '2017-06-17 23:59:59' But it is not selecting the data of the…
-
1
votes2
answers178
viewsGroup data from a table
I have the following sql statement: Select Notas.NotaID, Materias.MateriaNome, Alunos.AlunoNome, Alunos.AlunoID, max(case when NotaBimestre = 1 then Nota else null end) as 1bim, max(case when…
-
1
votes1
answer88
viewsWhat’s wrong with this query?
I am wanting to subtract the total value of a column from a table, with the total value of a column from another table. Query: SELECT ( SUM(r.valor_receita) - ( SELECT SUM(d.valor_despesa) FROM…
mysqlasked 7 years, 5 months ago Eduardo Henrique 124 -
1
votes2
answers165
viewsGROUP BY WITH ORDER BY
How to make a GROUP BY in the MySQL respecting the results obtained with the ORDER BY Ex: ID(Primary Key) | nome | codigo | tipo 1 | Item E | 5 | 1 2 | Item D | 4 | 1 3 | Item B | 2 | 1 4 | Item C |…
-
1
votes1
answer65
viewsMaximum number for a field in the database
I would like to know if it is possible to limit a maximum value to a field, e.g.: I want the maximum level number to be 200 in the mysql database. it is possible this through an update, in which way…
-
1
votes1
answer795
viewsSELECT DINAMICO CODEIGNITER - AJAX
Hello! I have the following tables: tbl_lancamento tbl_category tbl_burden Whereas in tbl_lacamento there is a field (id_categoria) that receives the ids of tbl_categoria and tbl_categoria receives…
-
1
votes0
answers18
viewsPerformance between Mysql Update types
Good evening, I need to update a table 'a' in the rows where there is no occurrence in table 'b', where table b has about 7 million records. I imagined two solutions but I can not say which would be…
-
1
votes1
answer570
viewsConnecting with Mysql
How to fix Mysql database connection error with Pentaho Error Connecting to database [School] :org.pentaho.di.core.Exception.Kettledatabaseexception: Error occurred while trying to connect to the…
mysqlasked 7 years, 5 months ago Gessica Liz 11 -
1
votes2
answers2463
viewsMysql select multiple columns from the same table with conditions
I need to select some data from a single table depending on the type of user, for example, a Personal user will have the field RG and PIS while a user will have the field State registration and…
-
1
votes0
answers246
viewsMigration with multiple banks in Laravel
I am trying to create a Migration that has a foreign key referencing the id of a table from another database, both Mysql. Follows the code: //config/database.php 'mysql' => [ 'driver' =>…
-
1
votes0
answers132
viewsWordpress - Lock Wait timeout exceeded - wp_cron
Sirs, I am facing the following log, but I don’t have enough knowledge to fully understand it. How can I solve such a problem ? It has been happening constantly, but do not know how it is generated,…
-
1
votes2
answers558
viewsList two distinct tables and filter by Mysql data - PHP
My problem is that I need to list values from two different tables, and I’m using a filter to add conditions in the query. For example: if(!empty($mes_especifico)) { $sql .= "AND…
-
1
votes1
answer683
views -
1
votes1
answer27
viewsHow do I select between two dates and bring in the query the value 0 on the dates that do not exist?
Example select data, valor from tabela WHERE data BETWEEN '2020-01-01' AND '2020-01-10'. I need that when there is no day 5, for example, the query return me the 10 dates and on day 5 the value is…
-
1
votes0
answers14
viewsORDER BY between two datetime columns
I have two datetime columns: data1 and data2. I need to sort by the shortest date between the two columns. If data2 is not zero, displays data2 line; If data2 is zero, displays data1 line; How do I…
-
1
votes0
answers98
viewsThe Map (google maps API - javascript) stops working when I add a function in the script!
The map stops when I put the Connect function, when I remove it the map will appear again as always var map; var markers = []; function initMap() { map = new…
-
1
votes0
answers65
viewsMysql auto_increment of 2 in 2 (2, 4, 6...)
How do SQL auto_increment to increment the number from 2 to 2 (2, 4, 6...) in an identifier field? create table cliente ( idcliente int not null auto_increment, nome varchar(40) not null, cpf…
-
1
votes1
answer197
viewsTaking Mysql Data Using Php and Passing to Javascript
I’m using that code: <?php include '../config/config.php'; if($_POST['type'] == 'load_url') { $id = (int) $_POST['id']; $sql = mysql_query("SELECT * FROM players WHERE id='$id'"); $item =…
-
1
votes1
answer42
viewsHow to make MYSQL SELECT "create" the days you don’t have in the table
I’m doing a MYSQL query that returns a download report a day, but in a few days it has no download. For example: ID|data 1 |2020-05-20 2 |2020-05-21 3 |2020-05-23 In this case, there was no download…
-
1
votes1
answer61
viewsdatabase issue
List only the names of customers who have made more than 10 car rentals. I started database a little while ago, if you can give me this strength I appreciate. created as follows: select Nome,…
-
1
votes1
answer88
viewsConnection error using namespace
I have a file that is responsible for the connection to BD and is in PDO. <?php namespace clientes\model; class conexaoPDO { public static $instance; private function __construct() { } public…
-
1
votes2
answers45
viewsHow to split a string in Mysql?
My Mysql database contains a table t_usuario with a column nome, where there is a record with the name Gustavo Henrique Almeida Martins. How can I make a SELECT to return only the name Gustavo?…
mysqlasked 4 years, 6 months ago Gustavo Martins 51 -
1
votes1
answer458
viewsSame page, different content?
All links have the same url but the data is different.. I’m working on a web based project that I have: categories of games: games(table with games in each category) description of each game(are…
-
1
votes1
answer537
viewsFunction mysql_insert_id() returns only zero
I am having problems with the function mysql_insert_id(), when I use the form below the value returned is always "0" (zero). Can help me? The "add" function calls the "save" function". OPEN_DATABASE…
-
1
votes2
answers703
viewsHow to make a welcome screen in PHP?
I want to create a welcome page for the user who has logged on to the site. My difficulty is in creating the query as I do and showing the user name through an echo? login.php form <?php…
-
1
votes0
answers27
viewsPass value by URL
Hello. I’m new to PHP and I have a question. I need that when my user access the link https://meusite.com/code.php?id=**01**&key=**12345** PHP read the values 01 and 12345 and consult within my…
-
1
votes1
answer190
viewsJava with Mysql (JDBC) - Type YEAR
I have a question on how to record a YEAR type in the MYSQL database using a Java application from a Textfield, I have tried using Date type, but I can’t take only the year to record in the YEAR…
-
1
votes1
answer804
viewsJquery autocomplete for city search, does not distinguish data from cities with the same name
I’m using Jquery, Ajax, PHP and MYSQL to do Autocomplete in a Brazilian city search field. When I type the name of the city the suggestions appear and when I pass the mouse over each city the code…
-
1
votes1
answer48
viewsQuery sql with ALIAS equal to column name with unexpected return
That consultation SELECT DATE_FORMAT(data,'%d/%m/%Y') AS ALIASdata FROM departamentos ORDER BY data DESC me returns the dates in the order I want 18/05/2020 17/04/2019 17/05/2018 17/03/2018…
-
1
votes0
answers40
viewsList 5 objects from a List
I’m putting together a panel that should show 5 products, for example, on a page index, but I can only load all the objects that are saved in the comic book, and I can’t think of a way to do that,…
-
1
votes1
answer725
viewsSave only day and month in mysql DATE field with php?
I need to register commemorative dates in the database, but I only need the day and month, the year is not relevant and does not need to be registered. My question is this, I can only save the day…
-
1
votes0
answers133
viewsReport Viewer only works locally
I developed an ASP.NET WEB FORM application and used Report Viewer for reporting and Mysql. However, when you upload the application to the hosting (Godaddy), Report Viewer does not work. I tried…
-
1
votes0
answers236
viewsImage upload error with PHP
When sending the registration form name, email and password, but the image does not register and I can not find the error. A few unsuccessful attempts: When placing enctype="multipart/form-data" the…
-
1
votes1
answer40
viewsWhat is the use of declaring a column as Char(0)?
I know that CHAR(0) is not defined in ANSI SQL, but in Mysql it is possible to define a column specifying this type of data. What would be the use/usefulness of such a column?…
-
1
votes1
answer102
viewsStop database return - Mysql/PHP
I have a problem to finish a project, I need to return the records of a database table, however, in some records, have a data stored differently, so I need to stop the execution. I haven’t been able…
-
1
votes0
answers313
viewsTrigger does not work
I don’t have much practice in Mysql and need to create a Trigger to update a column of a table when a new record is inserted, but when you insert a new row, nothing happens. I’ve changed everything…
-
1
votes1
answer1819
viewsError: Entitytype<T> has no key defined. Define the key for this Entitytype
When running my application, the following error is generated: One or more validation errors Were Detected During model Generation: Ballpoint.DataAccess.Context.Booktable: Entitytype…
-
1
votes0
answers146
viewsError Code: 1093 You can’t specify target table’d' for update in FROM clause
I’m trying to delete the record from the table but returns me this error message, what I’m doing wrong ? I tested in various ways and I always fall in this message Error Code: 1093 You can’t specify…
mysqlasked 4 years, 3 months ago Andrews Gomes 458 -
1
votes1
answer84
viewsAre inheritance derived classes different tables in Mysql?
If I use inheritance and have 4 derived classes and my parent class is abstract, these 4 derived classes will each have a different table in the Mysql database?
-
1
votes2
answers53
viewsSelect with LEFT JOIN and LIKE
Hello, I have created a search field, and I need to return the results of tb_orders based on the client’s name. However, only the client’s id is saved in this table, and the search is done by name.…