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
answer42
viewsIs it better to repeat field or Join to access the relationship?
Hello, thinking about performance and also good practices, what would be the ideal in this scenario? 3 objects: - Enterprise - Person representing the company - Visit (object of a commercial visit…
-
1
votes1
answer26
viewsProblem in mysql query
I’m having a problem doing a mysql query. I want to select the id and name of everyone present, except those already in the booking table. SELECT DISTINCT tb_presentes.id_presente AS value_id,…
-
1
votes1
answer1283
viewsmariadb connection error
Today I installed the lamp in my manjaro and everything was working normally, until I went to test php with mysql and typed the code: $conexao = mysqli_connect('localhost','root','','data'); I…
-
1
votes1
answer111
viewsWhat better way to resolve the slowness of reporting?
At a time, I developed a page of reports, users have an option of filters, this working, but as the data in the database are growing this getting slower and do not know what is the best option to…
-
1
votes0
answers132
viewsAdding values of 1 Mysql Column with codeigniter
I need help fast. I am trying to create a function in Models, where only add the values of the 'value' column of a table. I’ve researched several questions here and I’ve asked them, but they’re not…
-
1
votes0
answers127
viewsMysql Database does not connect with Entity Framework
Galera to trying to connect a Mysql database with c# through the Entity Framework, but every time I click on the next button comes to nothing(with Sql Server goes the problem is with Mysql)…
-
1
votes1
answer62
viewsHow to group notifications
I want to make a system of notifications that come together when they’re the same type, like the ones on Facebook. For now I have the table with the following columns: user_id (person receiving the…
-
1
votes1
answer5696
viewsAdding a foreign key to mysql
I’m still learning how to create tables in Mysql and I’m having some difficulty. If you were to create a table with your relationship, you would create: CREATE TABLE estilo ( codigo BIGINT(20)…
-
1
votes1
answer46
viewsDjango csv error
Well, I have a problem reading csv and entering the data. I believe it is in Foreign key. The code is: View: def csvAih(request): coluna = 1 mes = 1 ano = 2008 while (ano < 2017): with…
-
1
votes2
answers4281
viewsSum variables value with foreach
I have a variable that performs a select function, returning from the database two values: $grupo = selectContas(); I would like to add these two values and store them in a variable, but only the…
-
1
votes3
answers195
viewsSelect with detailed like
How to perform a select because it may not be an exact comparison in the database. I know there is a LIKE, but I’ve tried and not surtiu the desired effect. The problem is this, I have to search in…
mysqlasked 6 years, 9 months ago Josivan Sousa 61 -
1
votes2
answers224
viewsWhy does Hibernate not list results if the select query calls table null field?
I have a Product Entity-Class. @Entity public class Produto implements Serializable{ @Id @GeneratedValue private long id; @Column(length = 70, nullable = false) private String cod; @Column(length =…
-
1
votes1
answer1036
viewsRemove Duplicates from Two SQL Columns
So the situation is this, I have a table and in it I have three fields, so I need to compare the (to = b) and see if there’s anyone like it. What my problem, I’m new in the middle of sql and I’m not…
-
1
votes1
answer603
viewsProblem when entering data into mysql database by java
My java code is working, but when adding data to an SQL table, the fields are being populated as NULL, even though added values. Part of the code into which the insertion occurs: public void…
-
1
votes2
answers573
viewsDoes anyone know why Mysql Select sometimes doesn’t work?
I am facing a problem, in which I have a table in the BD and it contains the data. However when I do the SELECT, some data it returns and others not. For example: On the table Codigos i have the…
-
1
votes1
answer57
viewsUpdate table so that a field has a unique value
How can I update a record in Mysql so that when I change a field of this record all other records change so that this field has a unique value? for example, I have a table called players and a field…
-
1
votes1
answer28
viewsProblems in a query performed within a Stored Funcion in Mysql
I have a problem in a consultation on Mysql held within a Funcion. The question is the following, among the various activities that the ai function performs, is to test whether certain data has…
-
1
votes0
answers22
viewsClose - before or after nection?
What’s better, close before or after the while? For example, Modo1: $sql= "SELECT * FROM tabela"; $rs = mysql_query($sql,$connect); mysql_close($connect); while($row = mysql_fetch_array($rs)){ $nome…
-
1
votes2
answers362
viewsSort Numbers and seasons correctly
Next I need to formulate a SELECT, whose function is to show episodes in order of seasons, example T1E1, T1E2, T2E1 continuously, for the following structure : `eid` int(10) NOT NULL, `aid`…
-
1
votes0
answers131
viewsProblems with memory buffer pool doMysql
Hello, I have a machine EC2 in AWS radando Ubuntu server. It turns out that the MySql stopped working and does not come back anymore. The log error shows the following: 160919 21:20:21 [Note] Plugin…
-
1
votes1
answer4217
viewsSave and Use images in database ( Delphi and Mysql)
Hello, I would like to know how to record images (.jpg, .png, .bmp, etc) in the Mysql database, using Delphi XE6. I would like to use Tdbimage, if possible, to display the images already saved in…
-
1
votes1
answer41
viewsUsing database mysql and php data
This code works correctly with fixed dates. How to use the dates that are registered in the mysql database? if (!empty($_REQUEST['year']) && !empty($_REQUEST['month'])) { $dates = array(…
-
1
votes1
answer29
viewsHow to echo a select DATEDIFF?
I made the next code $data_restante = "SELECT DATEDIFF(CURTIME(),$data) AS date"; $result_data_res = mysqli_query($conn, $data_restante); $dado_data_res = mysqli_fetch_assoc($result_data_res); echo…
-
1
votes0
answers124
viewsHow to know the index number in a multidimensional array?
Information: Rooms: 25; Teachers: 4; Q02, Q03, Q04: A student in a class classified the teacher from 0 to 10. From these numbers, a media was generated. There is a select with the list of teachers,…
-
1
votes1
answer43
viewsDate query in mysql?
I need to consult and introduce the birthday kids of the week at Dashboard system, but today a birthday is not being displayed and would like to know where is the error. Anniversary column:…
-
1
votes1
answer5860
viewsComposite primary key using a foreign key
It is possible to create a composite primary key using a foreign key? I have the table mov_estoque, where I thought to put as composite key the id_mov and id_prod, however, id_prod is a foreign key…
-
1
votes2
answers90
viewsHow to relate several tables?
Below I put an example I did in excel. How does a select exchanging the values of the table inf_musicas the value of the other corresponding tables? NOTE: I know the basics of SQL, I know you use…
-
1
votes1
answer512
viewsHow to add current record to previous record by creating a cumulative?
How to add current record to previous record,creating a cumulative? SELECT DAY(i.imp_data) AS DATA, m.mt_valor / m.mt_valor / CAST(DAY(LAST_DAY(NOW())) AS DECIMAL)* 100 AS META_DIARIA,…
-
1
votes1
answer71
viewsHow to list BD query
Good night! How do I list a query in the database? I have a bank where you store singers and their songs... I wanted to list Spotify style, listing numerally according to the amount of content in…
-
1
votes1
answer43
viewsWHERE do SQL returns unwanted values
SELECT x, y, z, f , g , h FROM torrents INNER JOIN w ON w = x WHERE y = '2' OR y = '7' AND f = '1' AND h < 4294967296 I named the f = '1' in the where so that he returns to me only the values…
-
1
votes2
answers472
viewscall image through the answer id in the form
I have a form, where each answer the result is stored in the database and presented in a table: <td> <center> <?php echo date('d/m/Y H:i:s', strtotime($row["data"])); ?>…
-
1
votes1
answer1277
viewsMysql ignore accents
I am in a project with bootstrap and php + mysql. I have a simple search: $y = mysql_query("SELECT *,date_format(`ultimologin`,'%d/%m às %H:%i') as `ulogin` FROM $tabela WHERE estado='$estado'…
-
1
votes1
answer315
viewsAllow number-only queries in mysql
I would like to know if you can prevent the query of words, characters and other things that can make an Injection sql on a site. I am developing a system for the history of a site, follow the…
-
1
votes1
answer49
viewsLEFT JOIN count likes
I have the following tables in Mysql (it is more complex than the example, I simplified): CURSO: id | nome CURTIDA: id | id_curso Every time someone enjoys a course, feeds the table LIKES Now, when…
mysqlasked 6 years, 9 months ago caiocafardo 1,897 -
1
votes1
answer1944
viewsAuto-relationship in mysql
I am trying to implement a table in MYSQL with self relationship, it is a table of employee registration, in which the administrator employee (F.A) registers the common employee (F.C) It would be…
-
1
votes0
answers241
viewsHow to deploy user from all devices?
I am working on an application and this doubt arose me while doing some tests, where I ran some changes, such as password change, on the computer but my user remained logged in to the mobile phone.…
-
1
votes1
answer1567
viewsInsert data into Mysql database received from a Json
I have the following problem, I have an app and I send some data in Json format, to the server, until ai blz, enough good in this format:…
-
1
votes1
answer30
viewsWrite numeric topic (1 1.2, 1.2.1) in Mysql with PHP
I have the following problem: I need to record in a database some conditions, which have their item numbers and upload as in this example: Test 1 Test 2 2.1 Testing I tried to do with numeric(4,2)…
-
1
votes2
answers180
viewsJavascript connection to the database does not work
Hello, I am trying to connect to Mysql database with a Phonegap/Cordova project and am experiencing problems. First I created the Cordova project and the only change I made was importing Jquery.…
-
1
votes1
answer375
viewsSoftware to Create Mysql DB Relationship and Structure
I have a project in mind and would like to map the data and create the relationship of the tables, even if only visually before developing the pages, could refer me a software (I think the concept…
-
1
votes1
answer209
viewsError Mysql and android connection
I’m developing an app that needs to have an external connection and I’m having a running problem, how could I fix this? Follows the code: import java.sql.DriverManager; import java.sql.SQLException;…
-
1
votes1
answer117
viewsWhat is the best way to post comments?
How can I organize a Mysql comment system An idea would be: id_post id_comentario id_user comentario Only it would take up a lot of space and it wouldn’t be so fast to process 2000 comments from…
-
1
votes1
answer76
viewsjava.lang.Nullpointerexception in method
package view; import br.com.genius.dal.ModuloConexao; import java.sql.*; import java.util.ArrayList; import javax.swing.JOptionPane; public class Chamada_ListaCompra extends…
-
1
votes0
answers60
viewsMysql does not save configuration
Good morning. I use Mysql version 5.5.20 on WAMP server. I have an SQL statement that needs a little more memory than is set by default, to return the data. So I increased the value of…
-
1
votes1
answer589
viewsEditable line with PHP and Javascript
I’m trying to create an editable line, so that when I click on it, Js brings me the inputs, allowing me to make the changes in that line and perform the Update in the database. Like this picture I…
-
1
votes1
answer414
viewsSql Injection in Stored Procedures
It is possible to carry out injection of SQL in Stored Procedures, especially when calling a Procedure for PDO of PHP? DELIMITER // CREATE PROCEDURE procedureTeste( string VARCHAR(255) ) BEGIN…
-
1
votes3
answers84
viewshow best to make a case_sensitive query
SELECT * FROM `table_users` WHERE BINARY nome = $nome AND senha = $senha Is that correct, or would it be bad practice?
-
1
votes2
answers728
viewsHow do I get Mysql to accept a 1.457.40 number?
I am developing an application that needs to automatically export excel sheets to the database. I’m using Mysql, but the spreadsheet data is not all well formatted the way the database accepts. I’ve…
-
1
votes0
answers554
views -
1
votes1
answer630
viewsHow to make the return of a Query (PDO)
How can I make the selected Month input bring me the selected user month and year? It is returning the user but when I input the Month to bring the user data for a given month does not come. this is…