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
answer218
viewsDATE_FORMAT - Mysql function
I have this query below, which brings all the information I need. However the field Resolution is with the date (yy-mm-dd), I need it to return with the date formed as dd/mm/yy: select * FROM…
-
0
votes1
answer140
viewsHow to print only one sale with your products using jasperReport?
I am trying to print only the sale you want with reports Jaspersoft, only that is printing all sales and all products that then added on other sales. Image of the report java imprint. String…
-
0
votes1
answer197
viewsMysql return JSON
I am trying to do this example but, is giving error: #1582 - Incorrect Parameter Count in the call to Native Function 'JSON_OBJECT' SELECT JSON_OBJECT('City', Name, 'Dist', District, 'Pop',…
-
0
votes2
answers57
viewsTable only fills the column title
I wrote the method below: public void setListaCompra() { String sql = "SELECT * FROM\n" + "(\n" + " SELECT \n" + " produtos.id AS id, \n" + " nome_produto AS Nome, \n" + "…
-
0
votes2
answers322
viewsFind lines of the last 24 hours that repeat the most (Mysql)
'SELECT `from`, `to`, count(*) AS num_clicks FROM my_rank WHERE my_rank_data BETWEEN "'.$yesterday.'" AND "'.$today.'" ORDER BY num_clicks DESC LIMIT 0,20'; Above I am trying to take the fields…
-
0
votes0
answers231
views -
0
votes1
answer30
viewscollect Tables from one mysql database and insert into another
Hello! have a doubt, there is a way to take information from a mysql database and insert in another with Tables having names destintos? for example: I want all database Inserts 1 table name and…
mysqlasked 6 years, 9 months ago Leonardo Marciano 3 -
0
votes1
answer325
viewsWrite JS to database with $_POST
Hello. I have a PHP script that runs an INSERT in a table of my database. The $_POST[txt_message] array shown in the code should accept JS content, but it is empty after Submit. He should accept for…
-
0
votes1
answer24505
viewsCould not connect: No connection could be made because the target machine actively refused them
I am trying to connect to my database. This is easyphp webserver 14.1. Follow php code for connection. <?php $HOST = '10.40.0.185:3388'; $USER= '*****'; // Aqui informei o usuário do meu banco…
-
0
votes1
answer235
viewsSelect best selling products from each category
Hello I have a table with id, id_categoria, product name and quantity sold. I want to list the first products sold of each category, even if the second or third product of category "A" for example…
mysqlasked 6 years, 9 months ago João Haskel 1 -
0
votes3
answers687
viewsUpdate with PHP variable
I’m taking a beating with a variable update. Please someone can help me? $servidorBanco = "localhost"; $usuarioBanco = "root"; $senhaBanco = ""; $dadosBanco = "db"; $conexao = new…
-
0
votes0
answers41
viewsDifferences between ways to set the charset in Mysql
What is the difference between these 2 ways to set the charset in the communication with the bank? $pdo = new PDO("mysql:dbname=qualuqer_db;host=localhost;charset=utf8", "root", ""); and $pdo = new…
-
0
votes1
answer67
viewsGetting category of a table in Mysql
Staff I have a product registration table and in it I have categories: $consulta = mysql_query('select categoria from produtos order by categoria'); while ($var=mysql_fetch_array($consulta)) { echo…
-
0
votes1
answer1563
viewsCompare 2 rows of the same table
I need to make a MYSQL query. I have a table in which I have column "data_emissao" and "data_expiration". I need to find all the lines where they have the same due date, but different dates of…
-
0
votes1
answer54
viewsMigration from Local BD to Mysql BD
I am working on an ASP.NET WEB page with MVC and I have made all model, control and display settings in Visual Studio 2017 and the same created a Local BD by SQL Server Localdb to store the data but…
-
0
votes0
answers120
viewsPHP does not query the database with rowCount()
Good people I am making a Login system, but I believe, I have a problem with the connection with the database, because only returns the value false, and true involves a query with the BD... below…
-
0
votes1
answer653
viewsError in Mysql installation
After trying to install LAMP package on Ubuntu 16.04, I am getting the error: ERROR 2002 (HY000): Can’t connect to local Mysql server through socket '/var/run/mysqld/mysqld.Sock' (2) I have…
-
0
votes0
answers80
viewsIdentify and list which users viewed an Laravel post
Good afternoon, for study purposes, I am creating a communication system, where users register communiqués on a timeline, but I came across the following question, How would I show which users…
-
0
votes1
answer995
viewsHow to use If with Insert in Mysql?
I have a variable x, and I want to check its value with an if, and if the value is above 10 (for example) I want to perform an Insert in a table, otherwise a select in it. It’s something relatively…
mysqlasked 6 years, 8 months ago Bruno Henrique 122 -
0
votes1
answer1220
viewsSQL to find number within a range of two Mysql table fields
My Mysql table has the following fields: id; num_min; num_max; The user will enter a number and need to check if that number is in the range between the column num_min and num_max of the table. I…
-
0
votes1
answer827
viewsHow to make a SELECT with SUM and DISTINCT?
I need to make a select in the bank using sum and distinct. I tried that: SELECT DISTINCT `conta_idconta`, SUM(valor) AS ValorTotal FROM contaSaida WHERE conta_empresa_idempresa=1 AND…
-
0
votes2
answers139
viewsProblem Code UPDATE MYSQL PHP
Someone could confirm me if the code below is correct, I’m not good in php or mysql, I just do arrangements and I’m not getting the expected result, the connection with db is correct, no…
-
0
votes1
answer91
viewsError: Undefined index: Password in C and error Strict standards: Only variables should be passed by Reference
error referring to the same line of code : $stmt->bindParam(':Password', password_hash($_POST ['Password'], PASSWORD_BCRYPT)); Who Accumulate and record the information entered in the form with…
-
0
votes0
answers23
viewsPHP PDO, what is the practical difference in parameter sending?
I’m having a question using the pdo in the php, there is some practical difference in implementation using these two approaches? $db = new PDO("ok"); $sql = "INSERT INTO tabela (campo1, campo2)…
-
0
votes1
answer332
viewsAs defined in the database the confirm password field
When registering in the system the user will have to confirm the password to register, however I have no knowledge of how to proceed and if this is done with some function in PHP or some validation…
-
0
votes2
answers937
viewsView and modify items in the database with php
I need to display the database values in these input fields and also edit them, I already have the column created, with Title & Adscode table name is website…
-
0
votes1
answer721
viewsConditional in Mysql
I would like to get a string obeying a condition in Mysql. For example I have a table with a column name descritor which is filled with PT or MT, would like to get the string Português for PT and…
mysqlasked 6 years, 8 months ago Miguel Silva 491 -
0
votes1
answer79
viewsconsultation of datepicker dates
good afternoon guys. How do I view the database data through the date selected in the datepicker? How should select be used in this case? since it is the user who will choose the date to display the…
-
0
votes3
answers252
viewsReturn the row of a table when the value of Count(field) is 0 in Mysql
I need that even when the search does not generate results, is displayed the value 0, I tried with the following SQL search, but without success: SELECT c.categoria as categoria, CASE WHEN…
-
0
votes1
answer189
viewsSelect advanced sql
I would like the column id_post_gru to be filled in 2 based on the amount of id_group where there is 70 I did it separately and it works, but together it doesn’t! UPDATE posts SET id_post_gru =(…
-
0
votes0
answers105
viewsPhp Search Filter Mysql
I have a database MySQL with various tables. Name of them below: Table: formacao Table: idiomas Table: usuarios I need to filter information, example: The person wants the candidate who is a…
-
0
votes1
answer59
views -
0
votes2
answers67
viewsHow to make a Count work by taking only the fields I want?
How can I catch a field I want doing the COUNT work? select PVN.NFNum, COUNT(distinct CtrlCargaNum) as Qtd from CTRL_CARGA cc INNER JOIN PED_VENDA_NOTA_FISCAL PVN ON cc.EmpCod = PVN.EmpCod where…
-
0
votes2
answers40
viewsHow to make two Select
I want to select the amount of like and slide of each post but am not getting the slide, someone can help me?…
-
0
votes1
answer45
viewsRun Trigger according to the value of a column
I need this Rigger to run when there is an update in the table auction, but only when the column value auc_status is equal to 3. That is, so the value of auc_status is changed to 3, he must run the…
-
0
votes1
answer137
viewsTurn DATA input into a PHP/JAVA variable
I hope you understand the situation: Programming a web page, I created a field data where the user chooses the date that should filter the information contained on the website, that is, show only…
-
0
votes0
answers91
viewsWhen giving transition rollback, reset id to the last id actually inserted
I want to avoid having jumps in the auto increment of id, in case there’s a mistake and I make it rollback in my transaction. And at the same time I want to make sure that no mistake happens if I…
-
0
votes1
answer96
views -
0
votes1
answer128
viewsHow to indent a new file name in an automatic "Drag and Drop" upload
I found a system of upload imaging Drag and Drop on the internet that makes the upload of the image in a specific folder and renames the file with a random name without having to submit the form.…
-
0
votes1
answer371
viewsBest way to create click report (PHP Mysql)
I’m putting together a real estate market system where developers can see the land available for construction. Then I want to record the clicks that each developer gives in any terrain and then I…
-
0
votes2
answers423
viewsCheck if the record already exists, if it exists does not change the value (MYSQL)
PHP functions <? if($_REQUEST['salva_ed']){ $sqlu="update registration set username='$username', firstname='$fname', lastname='$lname', sex='$gender', birth_date='$bdate',…
-
0
votes1
answer46
viewsInsertion of multiple GET lines automatically php
I have several lines like this: http://192.168.0.1/feed/data.json?id=71667&start=1426031940000&end=1426064520000&interval=30…
-
0
votes1
answer341
viewsHow to concatenate a list of an object into a property of another object?
I have the following model: public class Usuario { public int idUsuario { get; set; } public string Nome { get; set; } public string Email { get; set; } public string Senha { get; set; } public int…
-
0
votes1
answer6413
viewsINSERT and INNER JOIN together in Mysql?
Hello is possible to use the INNER JOIN together with the INSERT? I have a table A with 3 columns X, Y and Z and table B with columns W, X and Y and I need to insert in table A the column W of table…
-
0
votes1
answer982
views -
0
votes1
answer244
viewsHow to insert excel table in mysql using php
I have a table in excel with more than 300 lines and would like to insert the data of this table in mysql in phpmyadmin php usage currently Thank you for your attention!
-
0
votes2
answers1452
viewsIn Mysql which field type is suitable for storing weight in grams?
I have this doubt, what kind of field to use for weight like 0.900, 1.200, 2.000, 0.100 and be able to treat the fields as number in the query output?
-
0
votes1
answer1310
viewsIs there any way to recover the history of all queries executed on a Mysql server?
I have a transaction in a table of a Mysql and (php+apache) database. I wanted to know if I could recover (either in apache log or Mysql log) the ip from which the query that made this insertion was…
-
0
votes1
answer287
viewsStructure Array coming from mysql with PDO (organize)
Good evening, I’m having a hard time with arrays where I’d like them to stay in order so I can use them as follows. In my database I have many images that I call them with this code below. <?php…
-
0
votes0
answers20
viewsQuery in Mysql to call table data
In the case of the use of query SELECT * FROM, there is the possibility to bring all data from the table, but without ordering 1 or 2 columns? Because in the case of a huge table, it’s much easier…
mysqlasked 6 years, 8 months ago David Ferrari 67