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
votes2
answers1359
viewsSpecified conversion is not valid in Executescalar
The specified conversion error is not valid happens in the code: if (command.ExecuteScalar() == DBNull.Value) { resultados[j2][i2] = 0; } else { resultados[j2][i2] =…
-
3
votes1
answer80
viewsFull Text Index for Database facing Ecommerce!
I read several posts here on SOPT about creating índices which left me with many doubts I had, but my main one is about FULL TEXT! In a database that is exclusively aimed at ecommerce, where there…
-
3
votes4
answers196
viewsGet the id of where max(value) was found
I tried it like this, but it’s not the right amount SELECT id, data, max(valor) FROM teste WHERE data BETWEEN '2017-03-01 00:00:00' AND '2017-04-01 00:00:00' The maximum value comes perfect, but it…
mysqlasked 7 years, 8 months ago Christian Beregula 1,512 -
3
votes1
answer652
viewsConcatenate select result
I’m having a hard time showing the results of select the way I want it. I’ll explain first what I have and then what I want, I have two tables in the database: Product type: Product type, Product…
-
3
votes1
answer2309
viewsHow to make multiple checkbox records in the database at once?
How do I make multiple records with checkbox? I need to make multiple records according to my appointment on each checkbox and include in the column id_item the same ID that comes from the variable…
-
3
votes2
answers692
viewsProblems with accentuation in Mysql
I can’t save sentences or words with special characters ( ' & " ). My bank is like this: ALTER DATABASE `bancodedados` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; All fields in utf8 and…
-
3
votes1
answer389
viewsPost something on my website and post automatically on facebook
Good afternoon, I have a question I’m wondering. I saw in a system something very interesting that is when the person publishes some content on her site, there is a button that you select to publish…
-
3
votes1
answer2380
viewsExtract data from a BLOB field in Mysql
I have a select where there is a column where this returning me in <BLOB> QUERY SELECT * FROM user WHERE user_id=1 RETURN: id data_cad user_data 12 2017-03-01 21:38:57 <Blob> In the BLOB…
-
3
votes1
answer424
viewsCustomize List within Admin Panel - Wordpress
I am in a project, I need to make some changes exactly within the Wordpress panel. More specifically on a page that lists a specific list of posts. I need to add a custom search field with a…
-
3
votes1
answer229
viewsIpv4 and/or IPV6 record in the database
The Internet works through protocols like Ipv4 and Ipv6, possessing 32 bits and 128bits, which are numerical combinations that establish connections between computers. I have a device table,…
-
3
votes1
answer253
viewsDoubt mysql and Left Join
I have the SQL below, which returns data that I will fill in some inputs of a form. The problem is that I have 20 items (pieces) in this table, but it may be empty because the user can fill any…
-
3
votes1
answer683
viewsSelect fields to return in an SQL INNER JOIN
As I can in a single SQL statement line, like SELECT * FROM table1 INNER JOIN table2 ON xxxxx, and the desired return would be formed by all fields(columns) of table1 and only one field(column) of…
-
3
votes3
answers2114
viewsInsert if it does not exist or Update if it already exists in Mysql?
How can I in Mysql give a INSERT or a UPDATE if the line in question already exists or not? I tried it this way but it didn’t work: IF EXISTS (SELECT * FROM configs WHERE id_serie = :id) UPDATE…
-
3
votes2
answers616
viewsDynamic Connection EF C# Windows Forms Mysql
I have the following problem: EF creates a connectionString in the app.config and uses this connection always, but if you need to change the database server I will have to change the app.config. I…
-
3
votes1
answer42
viewsFind SQL values
I need help, I have an e-commerce table called product table, I need to list the product name, sales value, products with stock between 20 and 30 and any part of the product name has the letter "A",…
-
3
votes1
answer115
viewsQUERY containing different and or
I need to do a query where that person’s status can be A = Active, I = Inactive and B = Blocked but it can also be null, my query is already returning when it is A, B or I but when it is null it…
mysqlasked 8 years, 8 months ago Renan Rodrigues 3,709 -
3
votes2
answers1100
viewsHow to update or Insert in Mysql in the same query?
In Postgresql you can use the upsert. It checks if the line already exists, if yes it does update, otherwise it does Insert. In Mysql I’m not able to do this, I saw some talking to use INSERT ... ON…
-
3
votes1
answer7311
viewsHow to select in the database involving Foreign key and Primary key?
I have a problem, I have two tables that are related from the foreign key and the primary key like this: CREATE TABLE IF NOT EXISTS cargo( id INT AUTO_INCREMENT NOT NULL, nome_cargo varchar(50) not…
-
3
votes1
answer53
viewsDataset does not recognize LIKE and search parameters
Good night.I have a table in the Mysql database and am using a Dataset to handle it in my Windows Form project. The problem is that when I try to use a query with LIKE, it does not recognize the…
-
3
votes3
answers734
viewsMysql query with subquery in Nodejs
I have the following structure in the following tables. partner (idParceiro, name, email, phone) example partnerTag (idPartner, tag) What I need to do, a select in the partner table and do a for in…
-
3
votes1
answer1722
viewsWhat is the real difference between the operator '=' and LIKE?
Doing another test (rs) in a database I have in Mysql, I realized that: SELECT * From client WHERE uuid = '1kvsg4oracxq' returned the same result as: SELECT * From client WHERE uuid LIKE…
-
3
votes1
answer11657
viewsDuplicate database record with new id
I have a table in the database called user, with n fields, how can I duplicate a particular record only with a new id? insert into usuarios * select * from usuarios where id = x? Obs: this id is a…
-
3
votes3
answers2016
viewsMysql Ireport DATE_FORMAT months in English
I have some graphics using IReport, in one of them needed to show the date in "month/year" format. Using the code: DATE_FORMAT(data,'%m/%y') as mesAno can only show in English format (as image…
-
3
votes2
answers293
viewsInsert in mysql with strtoupper not accepting numbers and letters
I am doing the following Insert: <?php include "conexao.php"; $v_tipo = $_POST ["tipo"]; $v_funcao = $_POST ["funcao"]; $v_numero = $_POST ["numero"]; $v_responsavel =…
-
3
votes1
answer293
views"Too Many Connections" Java + Msql
Hello, I have following problem, I have a function that searches the database and returns an object. I have a "for" function that calls this method almost 300 times, due to this amount of calls…
-
3
votes1
answer97
viewsExpression nickname with SUM is not working
I’m trying to make a SUM in a query that performs some calculations. Follow the example: SELECT SUM ( (qtd - qtd_devolucao) * valor AS total) FROM produtos WHERE id_pedido = '47' I’m having the…
-
3
votes1
answer1127
viewsJSON Restful API Accents
Good morning, everyone, I am creating an API for study, but I have some problems with accents. When I do a search, I have an answer of not found. Goes down a test. There would be some solution for…
-
3
votes1
answer49
viewsDisplay only a maximum number of characters
My question, I believe, is quite simple, as I can do to display only a maximum amount of characters to the user, for example, 25 characters + "..." The idea is to limit the characters of these…
-
3
votes1
answer8774
viewsError creating Mysql foreign key in phpMyAdmin?
I’m having trouble creating foreign keys on mysql through the phpmyadmin. I have these tables CREATE TABLE `cidade` ( `idCidade` int PRIMARY KEY AUTO_INCREMENT, `nome` varchar(25), `Uf` CHAR(2) );…
-
3
votes3
answers1633
viewsHow to get the total and individual percentage per field in ASP Classico
I have the following scenario: My DB (in Mysql) has 1 million users, and this are divided into 3 categories of registration: Male, Female and Transgender. The goal is to categorize as follows.…
-
3
votes1
answer2019
viewsAutomatic backup with Mysql
Is it possible to perform automatic backup in mysql? Example: I direct a folder that Mysql will generate every day at 18:00 the backup of the database.
-
3
votes1
answer1391
viewsI unintentionally deleted all Mysql users phpMyAdmin
I was following some tutorials on the internet to change my mysql user password in phpMyAdmin and in the end I deleted this user. I lost access to phpMyAdmin and do not know how to solve this…
-
3
votes2
answers105
viewsQuery bringing all records, and filter the repeated
Have table mov_pallet(some records): movpallet rua altura posicao hora produto data pallet 1.424.959 1 C 4 09:30:07 18.342 02.05.2016 456.074 1.424.960 1 C 4 09:27:07 18.399 05.05.2016 456.182…
-
3
votes1
answer63
viewsHow to Restore Database to Recover Data?
Is there an automatic backup system? In my table there was a CNPJ field that contained Cnpjs and Cpfs, it was the type varchar I switched to the guy int and screwed it all up.…
mysqlasked 7 years, 2 months ago Igor Cacerez 161 -
3
votes1
answer561
viewsRead txt file whenever there are changes
I have a problem in a project I’m doing, I need to do a program that reads a txt file and imports it to Mysql, I was able to do this part. But now I need this program to read this txt file whenever…
-
3
votes2
answers187
viewsChecks if in a value group there is a value x mysql
I have a select that returns some data from the database, but I need this select to return the values only when in a group of values, there is the value x SELECT pessoas.id AS ID, pessoas.nom_pessoa…
-
3
votes1
answer96
viewsif only executes Else
Hello guys I have this function ifit collects a variable coming from login.php and does a check to choose between two menus. It just doesn’t matter the result inside the variable $permt he always…
-
3
votes1
answer39
viewsAccess SQL Server 2008 data from Mysql
Does anyone know if I can access data from an SQL Server 2008 database from a Mysql database? It would be something like Linked Server, but the other way around.
-
3
votes1
answer31
viewsHow do I check if a user has a confirmed email with only one query?
I have 2 tables, one of users and one of confirmed emails, which has a user FK and a confirmed user bool: - tbl_valida_email ========================= fk_id_usuario usuario_confirmado I was using…
-
3
votes1
answer3294
views -
3
votes1
answer152
viewsRedirect login page does not match
I’m having trouble redirecting the user after login. I need help to find a solution. valida_user_login.php <?php $servidor = 'localhost'; $usuario = 'root'; $senha = ''; $banco = 'bd_'; //…
-
3
votes5
answers40467
viewsHow to redirect php pages
I have a login system in a program PHP that I want it to forward users to different pages depending on their profile. There is a login table that has a field called "perfil" who is either 0 or the…
-
3
votes2
answers1003
viewsHow to display total rows of a table in a label
I don’t know how to pull the total lines of a table, code: public string Eventos { get; set; } SqlCommand comando = new SqlCommand("SELECT count(*) FROM Active", conn); SqlDataReader leitor =…
-
3
votes1
answer123
viewsLocate specific day of the week between dates
I have the following code to release on an agenda days and times available and for that I use the following routine: //recebo dados do formulario //inclusive o dia da semana ex.: Friday $dia_semana…
-
3
votes2
answers2280
viewsChange Varchar field to Date Mysql
I need to fix a table that was built wrong, the field that would store the date was created as varchar. With this structure I can not select a certain period, because varchar are ordered from left…
-
3
votes1
answer3954
viewsINNER JOIN WITH ORDER BY
In MYSQL I have two tables, product and product_photo. In the product table_photo has a field that calls first that normally its value is 0. In the administrative system of the site there can be the…
-
3
votes2
answers771
viewsMysql Workbench Error "Unknown File Encoding"
I have a problem, I backed up my bank, however when loading the script in the MySQL Workbench, I get a message saying: "Unknown File Encoding" If I choose utf8 get this message: I can only open it…
-
3
votes1
answer257
viewsIs Myisam the default Storage engine on this Mysql server?
I saw that message today: Myisam is the Storage engine by default on this Mysql server How so "default"? What is this defect? I use Innodb, and yet this message appears. Is there a problem with…
-
3
votes1
answer3043
views#1264 - Out of range value for column 'ano' at Row 1
Query: INSERT INTO veiculo(nome,modelo,placa,ano) VALUES('teste','testeModel','ASD5647',2012) Campos: nome | varchar modelo | varchar placa | varchar ano | int Reported error: #1264 - Out of range…
-
3
votes3
answers113
viewsSum between Mysql lines
I’m having trouble performing an operation using Mysql, I don’t even know if it is possible to do what I want. I have a control_de_stock table, in this table I have all the operations that are…
mysqlasked 7 years ago Cesar Vinicius 145