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
votes2
answers408
viewsmulti upload php
How do I get this script to receive multiple images, at the moment it only takes one at a time. <?php include 'connection.php'; $album_id = $_GET['album_id']; if ($_FILES['photo']['name'] !=…
-
0
votes3
answers1626
viewsSingle ID generation with Mysql
I am using the code below to test with a login system in PHP and Mysql. But the field nivel_usuario generates a number from 0 to 2, and I would like it to generate a unique 6-digit ID containing…
-
0
votes0
answers20
viewsHow to export 3 column values in MYSQL
I have a table with 129 columns and over 400 records, and due to some changes in the structure, I will need to redo it from scratch. But I would like to take advantage of the content related to…
mysqlasked 4 years, 1 month ago Top Sonhos 1 -
0
votes0
answers350
viewsI cannot display an image that is saved in the BLOB database
I saved an image in the BD in a field type BLOB but when displaying it does not display the image, instead it leaves the screen black with a white square in the middle follows the code: <?php…
-
0
votes1
answer44
viewsWhy is my WHERE statement in Mysql not working?
I have the SELECT below, and in the WHERE clauses the amount of credit would only be shown if >= 2, but even putting the condition, shows me everything. (fornecedor_credito.qtd_credito >= '2')…
-
0
votes1
answer2546
viewsParse error: syntax error, Unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or Identifier (T_STRING) or variable (T_VARIABLE) or
I can’t figure out where the mistake is. I believe it’s on my face, but I can’t find it! $inserir = $conexao->query("INSERT INTO cadastro (nome, sobrenome, email, senha, contrata, trabalha,…
-
0
votes1
answer176
viewshow to bring ten best media in mysql?
I have two tables: participants and results. In the table of participants I have idParticipant as pk and name; in the table results I have idParticipante as fk, result and date. For the result to…
-
0
votes1
answer275
viewsHow to make encrypted password queries in the database?
Well, I created a function called search party that should encrypt the user’s password and compare it with the database but every time I run I get the error: Warning: mysqli_fetch_assoc() expects…
-
0
votes2
answers59
viewsSelect record between the first day of month X and the last day of month X
How would the Mysql Query be for me to get all records of the selected month (using a select)? Date field is of type Date. SELECT * FROM tabel WHERE primeiro-dia-do-mes-x BETWEEN ultimo-dia-do-mes-x…
mysqlasked 4 years ago Brenno Sacramento 47 -
0
votes0
answers24
viewsHelp with a lower grade grade grade grade
Create a program that lists the discipline with the lowest grade point average. I can’t pull and the lowest grade point average and I hit a lock. I made this code so far. I really appreciate the…
-
0
votes1
answer69
viewsMYSQL returns OK
Good evening friends, Can anyone tell me why the query below returns OK? SELECT Count(*) as Dias_uteis FROM Owner.dias_uteis d WHERE d.data_util BETWEEN (select ts.creatión from Owner.tabela ts…
-
0
votes1
answer886
viewsError while restoring database using mysql folder
Good morning, I lost a hard drive where my databases were, but I have backup of the banks' folders. I took the briefcase from one of the banks and put it in: C: xampp mysql data And he appears…
-
0
votes1
answer18
viewsI made this code Join, I got it to return the expected values, but the values appear repeated. (Obs: I am beginner in Database)
select CLI_NOME, TEC_TELEFONE from tb_clientes join tb_tel_clientes on CLI_BAI_CODIGO = CLI_BAI_CODIGO where CLI_BAI_CODIGO in(2,3,4) order by CLI_NOME;…
-
0
votes0
answers13
viewsHow to make a query in Mysql Database by filter: in the last 3 days?
I am trying to make a query of users who entered my database in the last 3 days but have no return $condicaoData = date('yyyy-MM-dd HH:mm:ss'); $dataa = $condicaoData - '0000-03-00 00:00:00';…
-
0
votes1
answer19
viewsCreate a precedent that when you enter a date, it returns the day of the week corresponding to the date you entered. MYSQL
People with the following problem, I am treating dates in the format "YYYY-MM-DD", someone has an idea of a possible solution ? I am using SELECT WEEKDAY ('1999-08-06') AS day_day_week; how can I…
-
0
votes1
answer25
viewsQuery with multiple Mysql SELECT’s
SELECT prefixo FROM getVeiculosLinha AS V JOIN getLinhas AS L ON V.cod_linha = L.cod_linha JOIN tab_garagens AS G ON V.prefixo = G.onibus_prefixo SELECT c.local FROM status AS s JOIN cadastro_pontos…
-
0
votes1
answer35
viewsList $_SESSION from different php users
I searched a lot and nothing, there is the condition to list all users of different Sessions? For example this script I use, lists only 1 user. <?php include "db.php"; $qryLista =…
-
0
votes1
answer361
viewsTrigger to fill table with data from another table
I want to fill a table with the data being placed in another. CREATE TRIGGER `trg_jogo`AFTER INSERT ON `tabela1` AS INSERT INTO `tabela2` SELECT * FROM `tabela1`; I cannot do the process to copy the…
-
0
votes0
answers16
viewsHow to prevent SQL Injection (WHERE clause)?
How can I prevent SQL Injection in this case? <?php //==== GET URL PARAMETER $urlParam = $_GET['u']; $sql = "SELECT email FROM `users` WHERE keystring = '$urlParam'"; $result =…
-
0
votes0
answers17
views"java.lang.Nullpointerexception" error when trying to search a database list
Good afternoon! I have the error quoted in the title when I try to load the list of Patients from the Database. Follow the code: package servlets; import banco_dados.conexaoBancoDados; import…
-
0
votes0
answers465
viewsError saving Mysql PHP form information
What’s going on: I have a system that, after completing the form and saving, does not save the changes by appearing a alert "saved without changes" and back to previous page. What should happen:…
-
0
votes1
answer67
viewsMy SQL always adds 24 click to each access instead of 1
I have a script that counts the visits on my web pages and stores mysql, however, it is adding 24 clicks to each access, instead of 1. What’s wrong with this code? Look at the script: <?php…
-
0
votes1
answer40
viewsHow to individualize database queries with PHP?
Hello, good morning. I have the following problem: I want to handle SQL output using PHP, displaying the values individually and custom. For example, I have a database with the values Tomate |…
-
0
votes1
answer58
viewsid PRIMARY KEY, AUTO_INCREMENT starting from 1
I’m having a doubt, a stupid problem. Before to carry out this code: CREATE TABLE tabela ( id int AUTO_INCREMENT, title varchar(50), descricao varchar(100), PRIMARY KEY (id) ); when putting the…
-
0
votes1
answer37
viewsSingle line query result
My database is like this: id | municipio_id | ano | populacao 1 | 0 | 2010 | 5000 2 | 0 | 2011 | 5000 I have the following query: SELECT case when ano = 2010 then populacao end a2010, case when ano…
-
0
votes1
answer168
viewsphpmailer is not taking the values from my database
I’m trying to recover e-mail and password, where: $o_email = $_GET['email']; $celular = $_GET['celular']; Receives via URL the user’s email or mobile phone. But I am not able to get these recovered…
-
0
votes1
answer50
viewsError while trying to list objects that are in the database when using Foreach();
I am making this code to capture the elements of a table in my database but while executing the code foreach I get the bug and I don’t know what to do Function to fetch data: function…
-
0
votes1
answer360
viewsError trying to create a new Mysql table
I am encountering an error while trying to create a table in my database in Mysql. I read about this error in other occurrences here in stackoverflow, and it seems that it occurs when you try to use…
-
0
votes0
answers25
viewserror in foreign key creation
I’m studying bank and my foreign key does not create, I know I’m doing something wrong, but I can not understand what there is. these are the tablets I want to call' create table tb_cardapio(…
-
0
votes1
answer25
viewsHow to insert time together with date in c# with Mysql sgbd -
I use this line to save the date when I upload some record to my comic sql = "INSERT INTO ativacao (codigo, nomepc, data) VALUES (@codigo, @nomepc, curDate())"; this is only the first line and works…
mysqlasked 3 years, 10 months ago Mateus Félix 11 -
0
votes0
answers41
viewshow to save the form in the database?
Good afternoon to all I’m having problem to save in the database, I have the connection code in php certinho and the form in html but I do not know how to join them to save this <form has…
-
0
votes1
answer46
viewsHow to filter information when loading a local file?
Is there any way to ignore a certain information when loading a local file into Mysql? Example: I have a 2 column file: "PHONE" and "VALIDATED". The "VALIDATED" column has the values 'YES' and…
-
0
votes1
answer32
viewsHow to create a field in a table with pre-registered values?
I need to register in a 'PROJECTS' table the following fields : name, start date, end date, value, participants and risk. The risk field has to be whole with the following restrictions : 0 - low,…
-
0
votes1
answer41
viewsHow to divide the results from the comic into different lines as in an online store
Hello I’m trying to distribute the results from the comic in lines with 3 results at a time, as we see in several online stores, but the formatting comes out quite disorganized. I still tried to…
-
0
votes0
answers51
viewsControl of trolley products
Good morning! I’m making a system where the user chooses the products (where there is only 1 unit of each) and he puts these products in the cart. I need to control this cart for a certain time,…
-
0
votes0
answers13
viewsmysqli_query() expects at least 2 Parameters, 1 Given in - PHP error
I’m making a change in php, however, an error is appearing Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/canaljog/public_html/home/pages/principal.php on line 21 Connection…
-
0
votes1
answer65
viewsHow I remove the String from inside a Sequelize return
I made a select by Sequelize and it brings me this: [ TextRow { permission: 'group.default' }, TextRow { permission: 'group.fundador' } ] But how do I get only the 'group.#' of that array? I want…
-
0
votes0
answers49
viewsHow to increment an external variable to a callback in Nodejs?
Hello! I want to increment the hierarchy variable, but I can’t do it. Can someone help me? function getHierarquia(id, req, res) { var hierarquia = ""; res.locals.connection.query('SELECT id,…
-
0
votes0
answers21
viewsNumber of aborted connections too high MYSQL/Mariad
we have a Mariadb server here, and was analyzing these days because the same is a little slow, and I came across these numbers, someone could explain to me better what this means, and if possible…
-
0
votes0
answers14
viewsConfigure Mysql connection in Eclipse for PHP
I use Eclipse for PHP and want to know if there is a way to connect the BD to my IDE, in order to suggest tables and other BD information in the autocomplete when writing Mysql queries in the…
-
0
votes1
answer71
viewsAdd mysql columns
Good afternoon, I opened a question yesterday but I could not express myself correctly, I have the following query SELECT C.id, C.name as NomePC, C.serial AS Serial, MF.name AS Fabricante, CM.name…
-
0
votes3
answers968
viewsHow to use SHA1 in login with PHP picking up parameters?
I created a registration using as password encryption the SHA1, where the password parameter step as: $senha = sha1($_GET['senha']); However, I’m not sure how to decrypt, still passing parameter,…
-
0
votes1
answer367
views -
0
votes0
answers28
viewsI want to make a select in my database to see all the results that are: status = 1
$sql = "SELECT * FROM pagamentos WHERE status = 0"; while($aux = mysql_fetch_row($sql)) { echo '<td>'. $aux['nome_cliente'] .'</td>'; } …
-
0
votes0
answers25
viewsWhat happens when an after Insert or after update Rigger fails?
I have a question about triggers. If there is an after Insert or after update Rigger and this Rigger has an SQL routine that cannot be executed or it fails what happens to the updated record /…
-
0
votes2
answers277
viewsChange mysql timestamp field via php
I have the following database: CREATE TABLE Perdidos` ( `idPerdidos` INT UNSIGNED NOT NULL AUTO_INCREMENT, `dataEncontrado` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `descricao` VARCHAR(45) NOT…
-
0
votes1
answer31
viewsLimit in Laravel 7
I’m with the following Query in Laravel 7. $itens_carros_melhores_ofertas = Veiculo::where('status', 1) ->orderBy('ano', 'DESC') ->limit(6,9) ->get(); The problem: I need to display the…
-
0
votes1
answer120
viewsSUBSELECT WITH COUNT(*) SQL
SELECT CPF FROM ZPCF WHERE CPF IN (SELECT TELEFONE, COUNT(*) FROM ZCPF WHERE GROUP BY TELEFONE HAVING COUNT(*) > 1) I need you to bring Cpf along with phone numbers, there are phones registered…
-
0
votes2
answers48
viewsMysql - Add values from a column and also bring value from each row
I have a certain column and need to return both the sum of the values of the same, as well as the individual values of each row. I did a test with UNION and even worked, the first line returned to…
-
0
votes1
answer30
viewsMy Sql, query with two different parameters for the same column to bring two different results
I have a situation that I need to calculate the total number of rooms over 50 meters, then I need to calculate those over 100 meters, and so on. Is there a way I can do it in the same query? I need…