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
votes0
answers43
viewsSelect data in three Mysql tables and bring the latest result with the sum
I am trying to join data from three tables using this sql: select c.NOME,c.CPF,e.DATA_CAD ,e.ENFERECO as ENDEREÇO_Atual , sum(f.VALOR) from cli1 as c inner join end1 as e on c.IDCLI1 = e.ID_END…
-
1
votes0
answers22
viewsUse 1 field with foreign key to identify multiple tables
What I would like is: Create a log table In the Logs table have a field ex: FK_ID, where this field would identify any data from any table. Because the table logs will have the logs of all tables in…
-
1
votes1
answer44
viewsPython base 64 for image
Personal I’m taking 1 photo from the database but it’s coming as base 64 , that I need it to turn image again to be able to locate on the screen , how do I turn the base 64 into Bites again? I tried…
-
1
votes0
answers105
viewsPassing PHP-MYSQL values to Modal
I have the following problem, I need to send to Modal data coming from the Database, See below my screen and my code. <thead> <tr> <th>Foto</th> <th>SKU</th>…
-
1
votes2
answers67
viewsIs there a better way to deal with relational and non-relational databases in the same project?
I am refactoring a code, where I process some data and send it to a database. I have two versions. One where I use Mongodb and the other where I use Mysql. But I’d like to put the two versions…
-
1
votes1
answer79
viewsNodejs: In a controller method, how to perform two different model functions?
I need to render a page with the data of an Author and the listing of their News. In this case, I am considering two tables: authors and news and their respective models. Database: Mysql;…
-
1
votes0
answers38
viewsCurl Json returning strange characters, unable to save to database
I would like some help and I apologize if there is already an answer to this question here. Thus: If I execute the command below via SSH:: curl -X POST \ https://pos-api.XXXXXXX.com.br/oauth/token \…
-
1
votes1
answer37
viewsMysql - exchange contents from ISO-8859-1 charset column to UTF-8
It is possible to swap the content charset of specific columns? I have a database with the following architecture: :: Idcontent (int autoincrement) :: Title (vchar) :: Summary (vchar) :: Content…
-
1
votes0
answers23
viewsBest way to eliminate duplicate rows in a mysql table (Best Practice)
Expensive, I’m doing my first project on Mysql - I’m not an expert yet - so forgive me if the question is too easy. I am migrating data to the Mysql database - it should have about 4-5 million…
-
1
votes2
answers68
viewsSum of a product returning in a column the total
Sum of a product returning in a column the total Guys good night, I wonder how I can make a SELECT that returns exactly the same as what is below (I modified in F12 to see if you can understand…
-
1
votes2
answers107
viewsHow to save the Insert Radio Button with Bootstrap to the Mysql database
I am developing a registration form but I had to include a field (Radio Button) in my project. However, I am unable to save the Radio Button Insert to my Mysql database. The code below is in…
-
1
votes0
answers25
viewsProblem with Trigger in select/Insert
Personal I created two entities, where the information of one is manipulated by the other. That is, I own an entity conta and another conta_extrato the balance of the entity account is modified only…
-
1
votes0
answers17
viewsCombobox updating the database data
I am developing a page that will serve to edit the support calls : open, pending and solved. But before the fields I created in Mysql I cannot update to update what I want. <form role="form"…
-
1
votes1
answer58
viewsSQL does not calculate with NULL values
I have a query where I have 3 columns grouped and last totaling 3, the problem is for Edson the query is not TOTALING. TOTAL = CREDIT - (DISCOUNT + REBATES) The total Edson has to give 266,49 but my…
-
1
votes0
answers31
viewsError trying to host my website
I’m with this mistake when I try to host my site, I’m using shaman Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\Nova pasta\htdocs\dashboard\bd.php:21 Stack trace: #0…
-
1
votes1
answer46
viewsAuto increment skipping values
I am developing a code initially registration and login, everything ok. I added a Unique Constraint to the database columns that I don’t want you to repeat and it worked fine. However, I would like…
-
1
votes1
answer204
viewsJava converts accented characters to "strange" characters
I am facing a somewhat strange problem. I have a Mysql database in version 5.6 and a table with field of type longblob that stores a text in compressed HTML format (ZIP). When my website makes a…
-
1
votes1
answer35
viewsGroup by records by date and user id
Good afternoon! I have a table like this: I need to perform a SELECT that counts how many records I have per month and year, but grouping together the "repeated" records...(Records repeated in this…
-
1
votes1
answer49
viewsPDO does not return error even in a Try catch block
I was trying to register in a mysql database using PDO. Do not register but even so I did not have an error return despite the block try catch. I later discovered that the error was the column size…
-
1
votes1
answer101
viewsIs it possible to link tables with keys stored in JSON column?
I have two tables: CREATE TABLE jtable (id integer, jdata JSON); INSERT INTO jtable(id, jdata) VALUES(1, '["1","2","3"]'); INSERT INTO jtable(id, jdata) VALUES(2, '["1","3"]'); INSERT INTO…
-
1
votes1
answer22
viewsCalculate value difference from same column after sum with condition
I wanted to calculate the balance of an extract, since I have fields like extrato_tipo and extrato_valor, whereas the extrato_tipo I use to be able to define whether the extract is input or output.…
mysqlasked 3 years, 6 months ago gabrielfalieri 1,231 -
1
votes1
answer38
viewsI need to show a dataset in MYSQL
Need to pull the amount of matches played, amount of goals scored, create an average goal per match (average goals = Number of matches / Number of goals) all in one View, I did the VIEW but always…
-
1
votes1
answer44
viewsHow to select data that depends on other tables that have another key in common?
Hello! I was working on a database project using the SQL language in Mysql Workbench. The setting of my project is a university library where we have the tables: (Bold = PK | Italic = FK)…
-
1
votes2
answers50
viewsConnect 3 sql tables to each other using INSERT
Hello, before I try to work on PHP more deeply, I am studying the logic of mysql better, with select, delete,Insert etc. But when studying the sql database over time, I realized that in practice it…
-
1
votes0
answers18
viewsMysql Workbench is not importing the database, what to do?
I’m having trouble importing the bank I just saved into the workbench. Appears the message of finished, but does not transfer the bank, I have looked tutorials but no results, I have updated the…
-
1
votes1
answer46
viewsHow to create a followers table?
I’m doing a tcc project, which is kind of a social network..., I want to create a followers system but I don’t know how to put this in the database or how to relate the data I already have this and…
mysqlasked 3 years, 6 months ago Raian Medeiros Nolaço 13 -
1
votes1
answer37
viewsRefresh of an <input> containing Database values
Hello let’s start explaining what I need kkk Basically it is a game where I attack, after attacking it inserts in DB the CD turns, and at each new attack reduces the time by 1, what I wanted to do…
-
1
votes1
answer38
viewsSelect String attribute using Split and LINQ?
I have the following string "1,2,3,4,5,6,7,8,9,10," that I want to make a Split in a Select to search in the database if the number 9 is inserted in a field that receives strings of numbers. I want…
-
1
votes0
answers33
views -
1
votes1
answer27
viewsHow to exchange the primary key of a table in Mysql
CREATE TABLE Produto ( Codigo_Produto INTEGER, Descricao_Produto VARCHAR(50), Preco_Produto FLOAT, PRIMARY KEY (Codigo_Produto) ); CREATE TABLE Nota_fiscal ( Numero_NF INTEGER, Data_NF DATE,…
-
0
votes3
answers3483
viewsHow to execute a code by clicking on a link?
I am creating a site that will have a login system. When you log into the site, you will have several products inside, one next to the other... Each product will have its value, and each user will…
-
0
votes3
answers519
viewsWhy can’t I connect to my Mysql server?
I am trying to make a simple query using a PHP webservice. This is my current code: ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new…
-
0
votes1
answer62
viewsSet construction project JRE input path to 'Javase-1.7'
I am trying to make a connection to Mysql database, but when I use PreparedStatement, eclipse returns: Definir projeto de construção JRE entrada caminho para 'JavaSE-1.7 Yes, I changed the compiler…
-
0
votes1
answer354
viewsDifferent result between select, after applying SUM() and Grop By
I’m making a call report from elastix and I have a problem here in the outcome. Theoretically, if I don’t touch Where, the result would have to be the same. select distinct (case left( devices.id…
-
0
votes1
answer135
viewsContesting banknote database structure
I have a banknote allocation system where contestation, replica and/or rejoinder is allowed, which is the best way to store in the database? Create three tables (contestacao, replica, treplica)…
-
0
votes3
answers7312
viewsHow to count page views on a website
I would like to implement a page views counter on my site, present a numerical reference on the site, and use this data to perform a ranking of most accessed articles/post and automatically insert a…
-
0
votes1
answer480
viewsDo not enter equal data in the database
I’m taking data from an XML, converting to array and entering into the database. But I need only results that do not yet exist. It follows below my code, I have tried several other ways, none with a…
-
0
votes1
answer2127
viewsHow to change product categories in Magento via Mysql?
I did the import of csvof the products from my store but they came with all changed categories. Is there any way to exchange categories via mysql or in some other faster way?…
-
0
votes3
answers2192
viewsIncompatible date format when importing data from Excel to Mysql (00-00-0000 VS 0000-00-00)
I am trying to import data from an Excel spreadsheet to Mysql, the problem is that I have a column in Excel that dates are in format dd-mm-yyyy and the format accepted by Mysql is yyyy-mm-dd. I want…
-
0
votes1
answer453
viewsList/Static menu showing database option
I wish I could understand a problem I have here. I created a static list/ menu, but I need to leave marked option saved in the bank, when I have a table that allows me the relationship I do cool, as…
-
0
votes1
answer191
viewsPerformance difference in creating FK Mysql
Can anyone tell if there is a difference in bank performance if I create FK’s before the other fields in the table or vice versa? I heard comments that the ideal is to always leave FK’s as the first…
-
0
votes1
answer1533
viewsHow do I enter into a ternary relationship?
I am creating this model however I do not know if it is correct. I have basic knowledge in database. How do I enter into a ternary relationship that happens in Supplier - Suppliers_has_product -…
-
0
votes1
answer70
viewsIntegrating articles to a slider
I’m working on an article slider, whose articles are in a database that can be eleminated/added (CMS), everything is working perfectly, the database, and the slider. Now I just wanted to integrate…
-
0
votes1
answer364
viewsSyntax error when doing two updates in a single command
I’m trying to update more than one table in the same query, Local runs normal, but online gives syntax error in Mysql 5.1.72. What can be done to resolve? $query = "UPDATE isc_products SET…
-
0
votes1
answer127
viewsRegistration in the BD with pre-filled fields
I’m creating a system of registration on top of a system I found on the Net. In my system there are only 2 fields e-mail and password, and the password will already be pre-registered, missing so…
-
0
votes1
answer611
viewsConnect external php script to mysql from a codeigniter server?
I have a XAMPP server on an iMac OSX with a portal developed in codeigniter and would like to integrate into the mysql database an external script that is currently running via terminal and is not…
-
0
votes1
answer107
viewsReturning null value when creating table in Wordpress
I am creating a Plugin and need that when activating it create the table referent in DB, but dbDelta is returning that the table was created, but when checking using $wpdb->get_var returns a null…
-
0
votes4
answers1022
viewsHow to keep column 'order' in sequence even after editing the order of records?
I have a table with n fields, one of which is the 'order' (obviously it is sequential: 1, 2, 3, n...): id | ordem | nome ------------------------ 1 | 1 | Fabio 3 | 2 | Gilmar 2 | 3 | Rodrigo 9 | 4 |…
-
0
votes2
answers159
viewsRegex in Mysql to fetch certain X tempo results
I have a field in the table defined as DATE and the data is saved in this field as follows: year-month-day hour:minute:second Exemplo: 2014/04/22 18:32:00 I need to develop a query that returns me…
-
0
votes1
answer898
viewsAutomatically e-mail in PHP?
I have a website where you have a database, and in the same database, there’s a part where you have some dates, some of them that will still happen. What I wanted was that when each date of each row…