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
votes1
answer83
viewsSitemap Mysql PHP divided into result quantities
<?php header("Content-type: text/xml"); echo'<?xml version=\'1.0\' encoding=\'UTF-8\'?>'; echo' <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"…
-
2
votes1
answer518
viewsSELECT ... WHERE name LIKE bind_param
I have the following code: <?php $link = new mysqli("localhost", "root", "minhasenha", "meu_db"); $produto = $_GET['q']; $produto = '%'.$produto.'%'; $busca_produtos = $link->prepare("SELECT…
-
2
votes1
answer1081
views -
2
votes1
answer1256
viewsRun Mysql search after opening Modal
Guys, yesterday with the help of Bruno here on the page I managed to solve my need to create the modal but today I have a new difficulty, I could not pass over. Next with my modal opening through…
-
2
votes2
answers78
viewsSearch script does not return results or errors
Well, I created a search script in PHP, however, it does not display results, and also does not display errors. Phomularius <form class="navbar-form navbar-right" method="post"…
-
2
votes1
answer149
viewsWhat is the virtual data structure for in Dbeaver or Mysql?
Viewing a Mysql tables by Dbeaver, I noticed a tab called Virtual. In it it is possible to create Virtual Columns, Virtual Foreign Keys, Virtual Unique Keys and Referências Virtuais. What is the…
-
2
votes4
answers774
viewsConcatenate variables from an array
I need to concatenate variables from an array, to run an SQL, this array can have differentiated values. If the array is greater than 1, then it must have $variable + $variavel02. If the array is…
-
2
votes3
answers895
viewsReturn Id’s That Are Not in Database - MYSQL
Problem In a table X and I own N records, but these records are not sequential (throughout Insert, Id will always be larger than the previous one, but not necessarily the next number). I need to…
-
2
votes1
answer1778
viewsKey Foreign Relationship Problem in Phpmyadmin - Wamp
I have 'problem' in my Wamp, more precisely in the latest version (Wampserver 3.0.6 64 bit x64). When I create 2 tables, example: CREATE TABLE categoria( id_categoria INT NOT NULL AUTO_INCREMENT,…
-
2
votes1
answer372
viewsError using "greater than" in select command with case
I am trying to execute the following select command: SELECT estoque.id, produto.id, produto.descricao PRODUTO, case saida.quant when > 0 then (estoque.quant + sum(saida.quant)) else estoque.quant…
-
2
votes1
answer560
viewsUnique (dynamic) or custom query?
I’m developing a system and I’m trying to simplify my life with querys basics of insert and update, and I came across a question: I must create a query for each case, or one that meets all the…
-
2
votes1
answer81
viewsLaravel 5.3 update JSON Mysql field - #3143 - Invalid JSON path Expression
Query generated by Laravel: update `informations` set `parameters` = json_set(`parameters`, "$.'Campo teste'.type", 'string'), `parameters` = json_set(`parameters`, "$.'Campo teste'.value", 'Novo…
-
2
votes2
answers348
viewscheck user type for php access
I am trying to create an administrator panel. Ba database table has already created the type field, where if it is 1 is normal user and 2 administrator. What is the best method to search for the…
-
2
votes1
answer402
viewsQuery in multiple Node + Mysql tables
Taking into account the need to bring the result of a second table, based on the result of the first, how would you do this with Nodejs ? In PHP I would bring the result, and inside a while did…
-
2
votes1
answer25
viewsError in obtaining bank value
I’m trying to get the ID of a database with PHP. When returning the value, it always comes as 1. //Obtenho os valores por GET $description = $_GET['DESC']; $contentType = $_GET['TYPE']; $content =…
-
2
votes1
answer905
viewsERROR #1111 - Invalid use of group Function (SUM | COUNT)
This query gives me the total attendance of two parliamentary groups (e.g: PS, PSD) between two dates: SELECT DISTINCT a.partido, (SELECT COUNT(presencas.assiduidade) FROM presencas, reunioes WHERE…
-
2
votes1
answer52
viewsDifficulty mounting an SQL statement
I’ve been cracking my head here to mount an SQL, maybe someone can help me. I’m trying to draft a report to charge the relationship notes that were eventually deleted. The user registers an nf in…
-
2
votes1
answer47
viewsUsing the Handler function is skipping the ids. How do I make it not happen?
Take the example: create table time( id int not null primary key auto_increment, nome varchar(50) unique )engine=innodb; delimiter $$ CREATE PROCEDURE insertteam (nometime varchar(50)) begin declare…
-
2
votes2
answers1192
viewsDisplay Mysql date in date field
I have a customer registration page with a field for date of birth. I can choose a date and save it in the database. But when I return to the registration screen of this client this field…
-
2
votes1
answer69
viewsChange date to business date (Mysql)
I need to change the date of my database, considering the Business Date used in the company I work. Here, a commercial month is between 26/M-1/AAAA and 25/M/AAAA. Where M-1: last month. For example,…
-
2
votes3
answers818
viewsUpdate does not work
In my system has a registration page and a page with a table with the information of registered. In this table there is an edit button that links with an equal form of the registration page. What…
-
2
votes1
answer87
viewsTable with 2 td with select inputs showing return only in the first row
I have 1 table with 1 list of modules, and I have 2 columns that have options that can be chosen through select. The point is that the select’s only load the data in the first row of the table, the…
-
2
votes2
answers409
viewsSELECT AND UPDATE - Undefined index when submitting form
Hello I am building a content manager and I have a page where I return the results of the chosen country, so I can then update each field. When choosing each country on the Countries.php page, I…
-
2
votes2
answers3313
viewsI need to list the amount of an 'X' product that each customer bought
Below follows the structure and relationships of my database. I tried to use the code : `SELECT `cliente`.`Nome`, `produto`.`Descricao`, `contem`.`QuantItem` FROM `cliente`, `produto`, `contem`…
-
2
votes1
answer386
viewsAdd Mysql Connector to the instation package
I have a Windows Forms connecting to a database Mysql remote (is on a server). Basically, all it does is read data from a table, or write or anything. I am using the Entity Framework and my project…
-
2
votes1
answer147
viewsProblem entering data with methods. Java/Mysql
I get the following error when I try to add a new data into a table in my database. I have a class whose name is Banco de Dados , another whose name is ShowMenu and another whose name is Principal.…
-
2
votes1
answer794
viewsHibernate does not find mysql JDBC "Driver" class in Maven project
Hello guys I created a Maven project in eclipse (with WAR packaging) and imported the packages of models already mapped from another project, soon after I created a class to "load" a persistence…
-
2
votes2
answers82
viewsSearch in two tables
I have a media table with the fields id_midia, nome, tipo and another table of synonyms that has the fields id_midia, sinônimo. I need to make a query where it checks the two tables if the term…
-
2
votes1
answer1100
viewsPerform a date search in a timestamp column using spring data
I am trying to perform a search only for the current date in a column timestamp, or without giving the time and yes only the date. Model: @DateTimeFormat(pattern = "dd/MM/yyyy hh:mm")…
-
2
votes1
answer337
viewsError saving image in directory with PHP
I made a page that administer a website that is responsible for including new lawyers in a 'bootstrap Carousel'. On my machine works perfectly, but on the server it is impossible to save the image…
-
2
votes3
answers1358
viewsProblems adding Foreign key to Mysql
I’m having trouble defining the attribute anoAuto from the business table as a foreign key for cars.ano. Mysql always says "ERROR CODE: 1215. Cannot add Foreign key Constraint". create table…
-
2
votes1
answer41
viewsIs my database access function secure?
I have a file that has CRUD operations with PDO and Mysql, my question is if I leave my functions as the function below: function delete($tabela, $id) { global $con; $sql = "DELETE FROM " . $tabela…
-
2
votes1
answer30
viewsDoubt with SQL/PHP
I have the following query: $qrysel = "select * from pack"; $ressel = mysqli_query($db, $qrysel); $obj = mysqli_fetch_object($ressel); In html I have this: <?= $obj['pack_name']; ?> How could…
-
2
votes2
answers587
viewsSort by the result of the sum of two SUM - MYSQL
I need to order a query by the result of the sum of two sums. ORDER BY SUM(SUM() + SUM()) I tried the following: SELECT SUM(campo1 + campo2) AS soma1 , SUM(campo3 + campo4) AS soma2 , SUM(soma1 +…
-
2
votes0
answers41
viewsDB ERROR: SQL syntax;
I’m trying to create a temporary table with data from football teams, but I keep getting this error: DB ERROR: You have an error in your SQL syntax; check the manual that Corresponds to your Mysql…
-
2
votes1
answer879
viewsHow to search data from a table using other reference?
I’ll give you a simple example... I have a table 'products' that has in the columns, id, product name, value. I have another table 'users' columns, id, name. And another table 'buysdosusuarios' id,…
-
2
votes2
answers4640
viewsLEFT JOIN WITH GROUP BY
I am using PHP and Mysql, I have two tables in the database: POSTAGEM id ---- 1 3 13 CURTIDA id | id_usuario | id_postagem ----------------------------- 1 | 1 | 1 7 | 12 | 1 What I can’t do is this:…
-
2
votes1
answer36
viewsConditions on dates in MYSQL know which last record and penultimate
This is the following I need to perform a query in my database for the last registration date and where the featured is = to 0. Run this way smoothly: SQL1 = SELECT id, created, featured FROM…
-
2
votes1
answer356
viewsInsert only filled data from the PHP array
I have a chart, and I made a loop for her to receive input and also to make Insert, however I’m having problems in the INSERT and UPDATE. Where I have two fields codigo_tipo,descricao that are…
-
2
votes1
answer1104
viewsHow to set up remote database in Laravel 5.4
I am setting up bank in Laravel 5.4, but the same is hosted on another served, configured in Navicat is accessing normally, but Laravel does not connect. APP_NAME=Laravel APP_ENV=local…
-
2
votes2
answers990
viewsHow to encrypt GET and copy the parameter
I have an e-mail from feedback that is sent to a user after the service is completed. This email has 5 links, where each is the respective service note (from 1 to 5). I want to direct to the update…
-
2
votes2
answers320
views -
2
votes1
answer75
viewsProblem in SQL query in the Laravel
I’m not really understanding these queries in php Standard. I searched cities states where when searching the state lists the corresponding city, but it does not find the table id if the…
-
2
votes2
answers84
viewsAnchor validation for download
Next, I need to validate this form so that only after the person registers can they download the file. With the tag I can already have this validation but I was able to put to download only with the…
-
2
votes2
answers807
viewsHow to model n-to-n relationship correctly? Women also have friendship with men and not only men have friendship with women
Hello, I want to do the following: Create in Mysql the n-to-n relationship where men have friendships with women and women also have friendships with men. Example: John has friendship with Fernanda,…
-
2
votes0
answers375
viewsConnection to external database
I created a database on 000webhost and created a PDO connection to access it from my localhost in vertrigo <?php //CONSTANTES define('HOST', 'databases.000webhost.com'); define('USUARIO',…
-
2
votes3
answers189
viewsHow to properly make this condition?
I made this condition, so that if the person searches by name Andrey will run a require, otherwise it will not display, so any name I put in the search field is bringing the require, so is my code:…
-
2
votes2
answers95
viewsMysql parameter automation does not work
I’m trying to create a way to automate the business of adding parameters in the query to prevent sql inject, but it doesn’t work! This is my code: public static MySqlCommand…
-
2
votes1
answer91
viewsProcedure SQL (run every second)
Can anyone explain me how this mysql command will work? SELECT @row := @row + 1 AS n_linha , m.* FROM (SELECT b.user_id as prox_user_id, t.auctionID, t.productID, t.auc_due_price+t.auc_plus_price AS…
-
2
votes1
answer55
viewsIs it possible to "Group by" by column content?
I was wondering if it was possible to use GROUP BY based on the date of a column, in this case the column ANALYSIS that creates groups whenever it finds 0, instead of the column. DIA MES YEAR TODAY…