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
-
2
votes2
answers581
viewsDifference and sum of DATETIME column
I have a table called chamado_processos with the following structure and data As you can see one of the columns of this table called dt_processo is a field DATETIME and the column tp_processo…
-
2
votes1
answer421
viewsphp function does not insert records in the database
I have a php function that inserts two types of record in a Mysql table, according to the user’s choice in a combobox. The first combo option enters the records normally, but when I choose the…
-
2
votes1
answer27
viewsIs it possible to use IGNORE based on a field that is not PK, it is only a Single Index?
Taking into account the following modeling: ID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY PONTO INT (10) NOT NULL UNIQUE ENDEREÇO INT (10) NOT NULL (FOREIGN KEY) Where the field ID is a Auto…
-
2
votes1
answer59
viewsHow to list database time count result
I’m wanting to list a table record and display the sum of reported hours, but I’m not getting it. The Reports table has the Registration and Duration field registration duration 2501…
-
2
votes2
answers43
viewsSum of tables according to session id
What I am doing is the sum of the number of tables according to the id of the user who is logged in, the way I am doing no value is demonstrated. Bench: id id_affiliate user_ip date 1 2 162.70.25.00…
-
2
votes1
answer189
viewsBackup by mysqldump line by line
I am using mysqldump to export only my database data, but when exporting, it shows only one line with all the Inserts. Is it possible to make a registration insert per line? Ex: INSERT INTO TABELA()…
-
2
votes2
answers165
viewsRemove session when logging in
Good morning to you all! Gentlemen, I need guidance, and I also need to know if you have what it takes. It is as follows: I have a table in my database that records users who are logged in, it…
-
2
votes2
answers2202
viewsUpdate of several records together with select
I need to do UPDATE with SELECT for several records, today I am with this query: UPDATE banco.ordem SET valor = (SELECT (CEILING((litros * 3.67)*100)/100) AS valor_litros FROM banco.ordem WHERE…
-
2
votes1
answer92
viewsWebservice php without using Soap?
I have no familiarity with Webservice and wanted to know how to make one without the need to use Soap (to take data from the database and consume in Android Studio).
-
2
votes1
answer758
viewsSELECT for date with format dd/MM/yyyy hh:mm:ss
Consultation SELECT campo FROM Tabela WHERE data BETWEEN '2016-10-20' AND '2016-10-20' data and a field with type datetime ,I am having problems with the records for example that have the following…
-
2
votes1
answer808
viewsI can’t change records from a database table
The thing is, I need to make sure that my site can change login data, registered in the database. I did the codes, but when I click to change, nothing happens... The files I’m using: alteraadm.php…
-
2
votes1
answer130
viewsDoubt Simple School System
Well I’m doing a job for college, I’m already halfway through, but to do the precise end: The teacher can register a pdf/image in his area. And the student on his page can see/download this…
-
2
votes2
answers1206
viewsHow to reference foreign keys in registration forms?
I’m making a library website as college work, which has the following table in the database: My problem is that I don’t know how to handle php code and the form of fields that receive foreign keys.…
-
2
votes2
answers1842
viewsHow to import ACCESS data to MYSQL
I have a db ACCESS with many tables and a lot of recorded data, I need to import these tables for my new dbin MYSQL. someone knows a way ? or a tutorial to follow ? I’m using Mysql-Front and…
-
2
votes2
answers276
viewsHow to use INNER JOIN?
I have a table called Event and another call Category need to count amount of categories coming from event->category_id, but I need db to understand and read. TABELAS **event** |**Category_id**…
-
2
votes1
answer160
viewsINNER JOIN with Where
I have the following tables : permissions_users id_user id_permissao permissions - id - permission I have a session variable where I have the id of user , I need to do a table search for id and…
-
2
votes2
answers391
viewsFilter MYSQL results according to the result of a line
I’m having a problem to perform a specific filter in a query in Mysql. I am building a search system where I have the following tables: Questionnaires: with the name of the questionarios Questions:…
mysqlasked 9 years ago Jean K. Santos 33 -
2
votes2
answers321
viewsDoes the Mysql Select command differentiate numbers that have zero on the left?
I have a table on MySql which has a field called Codigo, of the kind varchar(20), this field in the case accepts codes that have zero left and codes that do not have zero to the left. Example:…
-
2
votes1
answer35
viewsConsult the most duplicated record
I have a problem to recover the teacher who teaches more subjects in this table, in which case I want to recover the code that has more duplicated records in the cod_prof column. create table…
-
2
votes1
answer63
viewsError in user registration, changing user instead insert
My problem is the following, I saw that when I edit a record , it works, the registration is changed, but when I want to register a new user, it falls in the editing condition, it edits the…
-
2
votes1
answer415
views -
2
votes1
answer2822
viewsHow do I turn a BLOB-type file into an image using PHP?
I need to transform a BLOB file that comes from a MYSQL database to the Image type, to use on my site, I need to do the conversion using PHP, when I use the image in BLOB format, it goes to the…
-
2
votes3
answers2032
viewsHow to relate tables in Mysql to more than one entity?
How can I relate a table(entity) to more than one entity in the Mysql database? following the following example... I have the tables: fornecedores, clientes and telefones. The fornecedores, may have…
-
2
votes0
answers356
viewsSelect dependent with three levels
I am setting up a simple system of booking vehicles for the company and I need to assemble a "triple" combo that will check the vehicle and the available schedules for it. I set up a double of the…
-
2
votes1
answer78
viewsShow the highest value of a field along with the field name
Hello, I have a huge doubt. I need to show in my table, in the home page of my site, which field of my table has the highest value and next to this field, show not only the highest value but also…
-
2
votes1
answer213
viewsError: "You have an error in your SQL syntax"
I’m getting the following error while executing the change attempt in the BD: You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for the right…
-
2
votes2
answers1898
viewsMessage to user after header change
I have a small problem with PHP, I need to redirect the user, but I wanted to notify you of what happened, I redirect you with the header(), but if I try to send something before the header failure,…
-
2
votes2
answers828
viewsHow to differentiate data from two tables with columns of equal names in an SQL request with JOIN?
I combined record of two tables using JOIN, the two tables have some columns with equal names... When extracting data with PHP how will I differentiate ? Example : foreach($dados as $values){ echo…
-
2
votes1
answer34
viewsDifficulty with PDO
I’m starting with the use of PDO and I have a doubt that I could not solve. I do the select below that will return me 2 hours: $sqlSaida = 'SELECT horario FROM HORARIOS WHERE COD = :codsaida UNION…
-
2
votes1
answer56
viewsImprovement in Chat application
I am developing a chat for my site where a user sends an invitation to the other user, if the same accepted will be open and the system will be checking new messages. For the system to do this check…
-
2
votes1
answer80
viewsCount records only if larger than the current datetime, with Count()
I have the following query: SELECT u.nome, u.email, u.login, u.data_cadastro, COUNT(*) AS qtd FROM patrocinadores AS p LEFT JOIN anuncios AS a ON a.id_user = p.id_user INNER JOIN usuarios AS u ON…
-
2
votes2
answers520
viewsencoding php to mysql database
Well, I have a problem with encode when throwing dice on a table mysql for php, my page is with encode utf-8, my bank using latin1, however, I do not know how I do such a conversion, if I change the…
-
2
votes5
answers1793
views -
2
votes1
answer345
viewsUsing multiple group by in a query
I have 3 tables: Products, Orders and Order Item. Table: Produtos id_produto foto_produto categoria sub_categoria --------------------------------------------------------- 0081 15487.jpg 4 32 0491…
-
2
votes1
answer521
viewsMysql Create a database for a single user
I want to create a database where only one user can access the information. Although there are already users created on the server, but only the user I create has to be the only one to have access…
-
2
votes2
answers4834
viewsHow to check in the database if the registration has already been made PDO
How do I check if the id user no longer has registration in the database and continue with the insert? if(isset($_POST['submit'])){ $comment = trim(strip_tags($_POST['comment'])); $insert = "INSERT…
-
2
votes1
answer451
viewsIndex limit with LIMIT
I have never been an expert in sql but I will always come, nothing that a googlada has not solved. But I have a doubt that I did not find information on this. Recently I did some testing to find out…
-
2
votes1
answer140
viewsTable multiplying the data
Well I’ve had this problem for some time and I’d like your help , have 3 tables that would be sale , vendaproduto , vendaservico . and I insert the items of the sale table in the other two tables…
-
2
votes1
answer2328
viewsMysql connection error: Headers and client library minor version Mismatch
When connecting to MYSQL database using mysqli class I am getting error: Warning: mysqli::mysqli(): Headers and client library minor version Mismatch. The error occurs when PHP version 5.4.16 is…
-
2
votes2
answers92
viewsDate calculations in the query
I’ve been having a hard time for some time. I’ve been researching, but I haven’t found anything that would help me. I need to make a calculation in a query, is the following. I need to take the day…
-
2
votes0
answers90
viewsImplementation of Doctrine 2.5 in Laravel 5.1 using mysql database configuration
I started using the Larable recently and managed to configure almost everything, but when configuring the database, soon after the installation of Doctrine, it returns me this error:…
-
2
votes2
answers2141
viewsUPDATE in multiple tables with the same column?
Let’s imagine a scenario where I need to give a update in 10 different tables in the same column in all of them updating a certain data, the syntax below will work? UPDATE tab1, tab2, tab3... SET…
-
2
votes1
answer7815
viewsInsert date and time into mysql automatically?
I am creating a system and I would like to know type fill the form below and how to insert in mysql the time and date as it is in the operating system . without having to input a date and time into…
mysqlasked 7 years, 10 months ago allan araujo 541 -
2
votes1
answer62
viewsHelp with INNER JOINS
I’m having a problem with INNER JOIN. When I do a search for a certain sale it brings me all sales related to the customer code, because it is the field "codcliente" that associates the 03 tables…
-
2
votes1
answer213
viewsHow to recover only 1 URL value with Codeigniter?
I’m passing two parameters http://localhost/topsamp-ci/votar/4-Slug-de-algo public function votar($id) { echo $id; die; } And it returns me 4-Lug-de-something. I wanted to just recover the ID but…
-
2
votes2
answers89
viewsMysql, help to understand data export
In the old days when I was exporting a database I was like this: CREATE TABLE `config` ( `ID_Config` int(1) NOT NULL AUTO_INCREMENT, `nome_site` varchar(255) DEFAULT NULL, `thema` char(50) NOT NULL,…
-
2
votes2
answers602
views -
2
votes2
answers824
viewsPDO - Problem with Fetchall
Good afternoon friends, my problem today is the following. I have the following query: set @row_number = 0; SELECT @row_number:=@row_number+1 AS row_number,il.* from itemloja il order by il.LojaId…
-
2
votes1
answer171
viewsDoubt with checkbox and PHP
I have 2 fields, as below, which are checkboxes: <tr> <td>Dizeres Legais:</td> <td><input type="checkbox" name="export_dizeres[]" value="PORTUGUES"> Português <input…
-
2
votes1
answer430
viewsChange . by , with PHP or Mysql
I have a table that saves data that comes from a txt and I have a value field and it saves in format: 5.00 How do I change in the database or PHP to 5,00? That is, changing the . (point) by ,…