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
-
0
votes1
answer300
viewsSelect if it does not exist in another table, but if there is no record in 24h
I have two tables: links Works I need to return the values of the links table, but first I need to see if it exists in the Works table, and if it exists it must have been inserted more than 24h,…
-
0
votes0
answers135
viewsJava/Mysql - Query error
Hello, I am trying to make a simple application to register in the bank with Java and I am getting the following error: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error…
-
0
votes0
answers90
viewsWhile iteration with date and time
How to organize the method JAVA below, to get the output as in the example. I have an array of times (would be input and output), and I need to associate these times to a date range, while I was…
-
0
votes3
answers864
viewsSearch two Mysql tables and select rows with a common element
What is the way to use a foreach for this situation ? Would be selecting an element from tabela dois - event - and for each event, pick up from tabela um data that also have in its structure the…
-
0
votes1
answer177
viewsQuery works in phpmyadmin, but does not work in PHP
I’m trying to do a query via php in Mysql , but it’s not working in PHP, but it works in PHPMYADMIN. $check_in = strtotime($arrival); $check_out = strtotime($departure); Queries I’ve tried in PHP...…
-
0
votes2
answers39
viewsMysql Query with multiple tables
I’m having trouble performing a select on some tables, I did the following. have 5 tables (module, components, step, images, records) the table records only receive ID’s from the other tables , it…
-
0
votes1
answer82
viewsReplace checbox for radio
I have this code where I create two columns of type="checkbox": $tabela1 .= '<td> <input type="checkbox" name= "Id[]" value="'.$rows_cursos['Id'].'"></td>'; $tabela1 .= '<td>…
-
0
votes1
answer48
viewsHow to use a Join clause by adding a column indicating the existence of a connection
I have two tables Horas (id, aluno_id, atividade_id) and Atividades (id, emblema_id) In addition to returning all the badges, I need to return a column that tells me if that student has it. To know…
-
0
votes0
answers605
viewsExport mysql data to csv
I am trying to export specific data from a client database to csv, I searched the internet and said I would achieve using the code below. SELECT * FROM escola INTO OUTFILE…
-
0
votes1
answer215
viewsEntity Framework Asp.net mvc data comparison
I need to receive the value and quantity in stock of a particular product according to your Id.By debug the product id is arriving correctly, but when I am going to assign the values to the table…
-
0
votes0
answers86
views -
0
votes0
answers27
viewsQuery mysql with special condition
I’m having trouble assembling a query with two tables. In my comic I have two tables called disciplines and bulletin, in disciplines have the data of each discipline and in bulletin have the foreign…
-
0
votes0
answers232
viewsERROR 1442 - Trigger AFTER INSERT - Mysql
My database has the following structure: CREATE TABLE BAIRRO ( BAI_COD INT(4) AUTO_INCREMENT NOT NULL, BAI_NOME VARCHAR(200)NOT NULL, CONSTRAINT PK_BAIRRO PRIMARY KEY(BAI_COD) ); CREATE TABLE…
-
0
votes2
answers586
viewsUpdate with foreach in the database
I show this data with the select and after the user query can edit three fields: Image, Treatment and Status. The State camp is doing the update correct in table, but the fields input type="file"…
-
0
votes1
answer89
viewsGet a record as soon as it is saved in the bank
I’m recording a record in my database like this: $tipo = $_POST['tipo']; $data = $_POST['data']; include 'conexao.php'; $result = mysqli_query($con, "insert into sessoes (tipo, data) values…
-
0
votes1
answer341
viewsHow to get select to be populated based on the variable selected in another select
I need to make that after choosing the product, in the quantity select display a list with the values according to the available quantity, for example: if you have 10 pieces of a pants, display the…
-
0
votes2
answers264
viewsMigrate EXTRACT(YEAR_MONTH,data) from Mysql to SQL Server
I have a Mysql query that would need to convert to SQL Server. I tried with datepart SQL Server but it does not maintain the main feature of the Mysql query, which is to maintain the range month by…
-
0
votes2
answers683
viewsSave image name and extension and upload to a specific php folder and then show in a table
When showing a query in a table I create these three fields for the user to update to the line showing the query data: <?php $tabela1 .= '<td> <input type="file" name=…
-
0
votes1
answer289
viewsSet variable to null in a Query in php
I have the following QUERY on my system: $Query = "SELECT * FROM Monit WHERE ($Modulo IS NULL OR Modulo = '$Modulo') AND ($Usuario IS NULL OR Usuario = '$Usuario') AND ($Data IS NULL OR Data_reg =…
-
0
votes0
answers396
viewsChange data using Checkbox - Php + Mysql
Hello, I am mounting an internal order system and would like to include status/situation steps, I am trying to do this in bulk using checkbox. Basically I want to select x number of items on a list,…
-
0
votes2
answers374
viewsError in Workbench database, birth date, error 0000-00-00
create table pessoas( id int not null auto_increment, nome varchar(50) not null, nascimento date, sexo enum('M','F'), peso decimal(5,2), altura decimal(2,2), nacionalidade varchar(20) default…
mysqlasked 6 years, 9 months ago joao paulo oliveira 5 -
0
votes1
answer320
viewsChange the directory where the folder will be created
I do this way the upload where creates the folder inside the wordpress folder: if (!file_exists($pasta)){ mkdir("$pasta", 0777); } $diretorio = "img/"; foreach ($registro as $Id => $estado) {…
-
0
votes1
answer50
viewsList zeroed results in query
Good morning, you guys, I need your help in a select, I’m doing a search, I have a 4 tables: user, question, alternatives and answer. In the answer table I save the user’s Cpf, the question id and…
-
0
votes1
answer55
viewsSearch table field with query result from a different table?
I asked a question recently: Find lines of the last 24 hours that repeat the most (Mysql) And it was answered, now I have another question. I do the following to seek from and to of the most…
-
0
votes1
answer594
viewsLinting is disabled for this query because it Exceeds the Maximum lengt
next I’m having a problem in mysql which is as follows, when I register an image in the text editor of my content manager, this image is converted to Base64, this editor is summernote, however the…
-
0
votes1
answer26
viewsCount Amount of Uploads in a Certain Period
I have the following query in my file: SELECT IDUsuario,IDArquivo,Time FROM uploads WHERE Time >= '2018-02-20 00:00:00' AND Time < '2018-03-21 00:00:00' And my result resembles that: In this…
-
0
votes2
answers74
viewsVIEW and JOIN, return the product, and the value with the latest date!
I have the following tables I created. CREATE TABLE produto ( codigo INT UNSIGNED NOT NULL AUTO_INCREMENT, nome VARCHAR(128) NOT NULL, url VARCHAR(255) NOT NULL, qde_min SMALLINT UNSIGNED NOT NULL,…
-
0
votes1
answer81
viewsWorking with Mysql/PHP dates
Within a select in the bank, I look for the expiry date of the product. I need it calculated by changing a status in the 'winning', 'critical' and beaten' response. I’m trying to do it this way…
-
0
votes1
answer213
viewsSum values in a Mysql Count
Good evening, I’m with a doubt I have a system that runs to seguiten query: SELECT IDUsuario ,COUNT('TotalDeUps') as Total, FROM uploads WHERE Time >= '2018-02-20 00:00:00' AND Time <…
-
0
votes1
answer173
views(SELECT JOIN?) How to get a number of records from a specific column, from another table (when there is a foreign key)
My listing screen shows the table data "PERSON". There is a table called MATRICULA q has the column idpessoa referencing. In this registration there is a field called EVADIDO to know if the person…
mysqlasked 6 years, 9 months ago Júlio Guimarães 3 -
0
votes2
answers96
viewsCorrect code to select and compare
I want to select * from table A that are different from table B and have used the following code: select * from Tabela A inner join Tabela B on A1 != B1 and A2 != B2 and A3 != B3 but the computer…
-
0
votes2
answers81
viewsTable populated by other tables
I need to create a table with PHP and Mysql that is filled by other tables, all tables have a column centro_cost, I also made a column code, for each centro_cost but I’m not sure how to implement…
-
0
votes1
answer72
viewsError storing byte in mysql db
I am trying to store what I get in db mysql, however this giving error I think is type of error column: 26/02/2018 09:25:14 User connected 26/02/2018 09:25:14 Login : Skell 26/02/2018 09:25:14…
-
0
votes1
answer892
viewsTake data from bank and compare CODEIGNITER
Good afternoon, you guys, I was trying to create a login system for a college job when I came across the following: I’m using Codeigniter and MYSQL I have a user database where you have registered…
-
0
votes1
answer34
viewsTable showing only a few columns of the database
I have a system that: On one page there is a search filter that when filled takes to another page with a table that only shows the records that meet the restrictions required by the filter. The only…
-
0
votes1
answer83
viewsDashboard with this information
I am wanting to create a simple Dashboard. exactly like this! in the field (ORDERS) would be the order count of the current day or by date. in the field (REVENUE) would be the value of sales on the…
-
0
votes0
answers319
viewsConnection to the database too slow
I don’t know what happened that now the connection to the database is taking too long. Before I was quick to give the answer if it was connected or not... now it takes about 15 minutes and my pc…
mysqlasked 6 years, 9 months ago joao paulo oliveira 5 -
0
votes1
answer651
viewsInvalid utf8 Character string + LOAD INFILE+ MYSQL LOCAL DATE
I am trying to import a stock file in CSV and in this files it contains several accents À Á Ú ' ñ etc in the fields Descricao , Nomefornecedor. Bank and and fields are UTF8 at connection instance as…
-
0
votes1
answer164
viewsSelect products by PAI category, with products registered in child category
Next, I made the following tables: CREATE TABLE produto ( codigo INT UNSIGNED NOT NULL AUTO_INCREMENT, nome VARCHAR(128) NOT NULL, url VARCHAR(255) NOT NULL, PRIMARY KEY (codigo) ); CREATE TABLE…
mysqlasked 6 years, 9 months ago André Felipe 63 -
0
votes1
answer255
viewsSomething equivalent to the sstream library from C++ to C
I need something similar to the stringstream you have in the C++ connection for the C language, I need it a lot because I want to make querys in a database using C (C mysql Connector). Since I had…
-
0
votes1
answer101
viewsPHP and Mysql Division without rest in PHP task division
Galley is the following need to assign tasks to a variable number of participants. EX: Through a select I got 49 tasks to be executed and I have to distribute to 4 employees. In other words the…
-
0
votes1
answer259
viewsHours manipulation [HH:MM:SS] - php and mysql
Good afternoon, you guys. I need to manipulate time fields [HH:MM:SS] in PHP itself. I take the text values in the HTML form as in the following example: <div class="item form-group">…
-
0
votes0
answers104
viewsDoubt in an error Node.js
I’m starting to do projects with Node.js, but I don’t understand why my code isn’t generating the view, and I don’t think it’s storing the data in sql. function Funcionarios (connection) {…
-
0
votes1
answer73
viewsHow do one query depend on the result of the other?
Consider the following table: +----+----------------+----------------+--------+ | ID | fk_resource_id | fk_language_id | value | +----+----------------+----------------+--------+ | 1 | 1 | 1 |…
mysqlasked 6 years, 9 months ago Filipe Moraes 8,737 -
0
votes2
answers181
viewsGenerate multiple records in Mysql
In the Mysql have two tables: CUSTOMERS | codigo-cliente | nome | grupo | valor | |----------------|------|-------|-------| FINANCIAL | codigo-cliente | codigo-boleto | grupo | valor |…
-
0
votes2
answers80
viewsI can’t see the error (PHP and HTML)
I wanted to show the names of the employees and the teams that they are part of so that if the user enters a name, it will filter all the teams that that person is part of. It’s coming in white.…
-
0
votes1
answer50
viewsImport from . txt using php + mysql
Good evening, I’ve tried other ways, but I couldn’t. I need to run the code query below at once instead of inserting row by row into the database. Someone would have salvation? <?php…
-
0
votes2
answers39
viewsEntering register in data group - error
Good afternoon, I have an error when registering some data in my database. Follow a part of the code and the error that appears. include_once("settings.php"); $con = mysqli_connect(HOST, USER,…
-
0
votes1
answer52
viewsSELECT similar to "INNER JOIN" cell by cell of the record?
I have little knowledge about SQL and would like to know if it is possible to make a SELECT in the same record (row), and for each cell value bring the corresponding record of a second table.…
-
0
votes0
answers23
viewsDoubt in logic for table of comparisons between plans - It is giving Timeout
I have the following table on my website, and today, it is static (not upgradable by Cmss). It has more lines than this image, but I only took a piece to illustrate. Today, in my database, I have…