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
-
1
votes0
answers25
viewsOptimize query by reducing Queries (+ 1 alias per subquery, is it possible?)
I would like to reduce the number of queries in my query. As the data are distributed in different tables, I collect the necessary information through comparisons with their Ids. Today my…
mysqlasked 5 years, 11 months ago Maykel Esser 598 -
1
votes2
answers129
viewsSQL & PHP - Select everything using Where
I’m making a very simple filter system using PHP and mysql. $stmt = $conexao->prepare("select * from filme where genero = '$genero'"); I’m wanting to put one on the list of genres that, when…
-
1
votes0
answers54
views -
1
votes3
answers69
viewsHelp with select in MYSQL
I would like to know how I do to list for each city the oldest clients, tried several commands but without success. I would like you to quote automatically. Below some commands I used, however I did…
-
1
votes1
answer122
viewsImage upload with AJAX and PHP
People need a help to upload images with AJAX, PHP and Mysql It takes all the data right, even writes the image path in Mysql, but does not create the file in the destination folder, what I want is…
-
1
votes1
answer287
viewsSelective foreach two tables
Please help me, I’m a beginner. Well, I’m with a website with codeigniter, it’s showing my recipes perfectly on: <?php foreach ($receitas as $receita) :?> Now I want to create a loop that only…
-
1
votes1
answer115
viewsI can’t make research work with eloquent and relationship!!! Laravel 5.5 and mysql
I’m doing a search taking a piece of word and playing a search like LIKE for fields fields. Use the Eloquent and relationships, but does not bring the data. { $pesquisa = $dataForm['pesquisa'];…
-
1
votes2
answers48
viewsDoubts with the insert
I have a form to be inserted in three different tables: <form name="customer_details" method="POST" onsubmit="return form_validation()" >…
-
1
votes2
answers52
viewsBD sales record
Good morning. I’m making a sales web app, and I want to return the sales ID to insert into the intermediate sales table (multiple products in 1 sale). I tried that way, but obviously I couldn’t:…
-
1
votes1
answer285
viewsHow to separate HTML from Java code from connection to the database?
I have a database and an html code that I finally managed to make connection but the code is kind of messy because it mixes html with java and mysql... Following example: <%@page…
-
1
votes0
answers201
viewsError while restoring mysql backup
Good afternoon Personal. I have a problem related to the backup and restoration of data from a Mysql database. I generated a backup of the data using mysqldump to format the pc and install a new…
-
1
votes1
answer361
viewsReturn JSON Infos in MYSQL in SELECT itself
I have a table in BD called "menu", with a column called STRUCTURE. It was text-like, and in it contains a JSON with a menu structure referenced by Ids from another table "category". Ex: [{"id": 1},…
-
1
votes2
answers1272
viewsStore all records of a table in a variable (PHP)
I need to make a query in my Mysql database and store all rows that are returned within the variable $dadosBrutos. The intention is that each line be separated by the character "§", for example:…
-
1
votes0
answers27
viewsPDO - Join in a function
I am inserting a new query in a functional system, however I am not able to understand how to insert a JOIN , I saw that there is the Function, I just can’t implant. I tried to run like this…
-
1
votes1
answer162
viewsINSERT WITH JOIN DUPLICATING DATA
Hello, I have these 3 tables in my database: Table colaboradores Table cursos Table c_vendas_itens I would like to make a Join of the three tables and save in another one, I can do this through the…
-
1
votes1
answer153
viewsInsert with three tables in Mysql with PHP
For study and testing purposes, I created three tables in phpMyAdmin: People, Contact, Credentiallogin. Contact and Credentiallogin tables are related to People. The goal is to perform the insertion…
-
1
votes2
answers308
viewsSort by larger ID and group the similar
How can I list the records by ordering by the latter, but when you have the field related filled, bring the other records with that same value? The general idea is to make a order by id desc and…
-
1
votes1
answer73
viewsSingle-line save in DB, the result of the PHP variable (WHILE/LOOP) of a MYSQL Query
I have the following problem: When performing a query, the while result is composed of more than one value, for example: $query_sku = mysqli_query($connect, "SELECT t.column_name FROM skus AS s…
-
1
votes0
answers434
viewsUpload files and images with PHP and Mysql
I’ve got a bug in my code only I don’t understand that is the code: <?php $db = new PDO("mysql:host=localhost;dbname=filedb;charset=utf8", "root", ""); $msg = false;…
-
1
votes1
answer130
viewsHow to convert and save Datagridview data to Mysql database
I have a field in the Mysql database of type Double(10,2) and a grid where the field is like this: VALUE: R$10,00 When I try to save from error by saying: The input character string was not in an…
-
1
votes0
answers132
viewsWhy is a hash in Bcrypt different each time it is encrypted? Correct way to compare passwords in Bcrypt
Good, I am trying to create a webpanel and a friend suggested me to encrypt users' passwords with BCRYPT for their security. My problem when trying to sign in, the encrypted password that is stored…
-
1
votes0
answers75
viewsString field in Mysql returns as bytearray type using Python
When performing a query in Mysql using Python, I get a return of type bytearray, being that the column is of type String. import mysql.connector as myc # conexão MySQL conMySQL = myc.connect (host =…
-
1
votes0
answers57
views"This page is not working" error on AWS hosted website
I’m setting up hosting a PHP site on an AWS free server, the login home page is showing up correctly, and when I confirm the form login, it goes to the page that checks the login data, and if the…
-
1
votes0
answers11
viewsPhp Mysql - Error in my Error-Logging function
I am trying to build a log system for php-mysql errors In my createtable() function I call errorLog() when I need to record an error. // Database - CREATE TABLES public function createTables($sql) {…
-
1
votes1
answer320
viewsCodeigniter and MYSQL - Query using CASE WHEN returning different result
I’m using the Code Igniter 3 and I’m doing a database query with the following code in the file Model: $this->db->select("*"); $this->db->where("CASE WHEN code = '001' THEN '1' WHEN code…
-
1
votes2
answers18166
viewsUninstall Mysql from Ubuntu
I’m trying to give up Ubuntu’s Mysql with the command sudo apt-get remove mysql-server --purge But every time it returns me an error saying that Mysql is already updated, I already tried to use the…
-
1
votes1
answer59
viewsCOUNT in multiple mysql tables
Good afternoon, someone can inform me that there is wrong in the code below ? Because he just does the Count check on one table the other he ignores. Insert is correct but "Select Count" does not…
-
1
votes2
answers294
viewsTake field letters in MYSQL
I have a field with information in this pattern: "PLC__Line" 34355655413.3912. What can I use to take out the letters, _ and " in a select, leaving only the numbers and the dot? In Postgresql I know…
-
1
votes1
answer50
viewsHow to pass a decimal type variable to a string type sql command with decimal separator "."?
I have the following Model class: public class ModelTransaction { public int Id { get; set; } [Required(ErrorMessage = "Informe a data")] public string Date { get; set; } [Required(ErrorMessage =…
-
1
votes0
answers64
viewsSequelizedatabaseerror - Syntax error when creating an ARRAY field in Graphql with sequelize and mysql
I am developing a basic API for blog graphql with Sequelize and Mysql as a database, everything works perfectly until I try to create a new keyword field of the Array type, for blog posts, I believe…
-
1
votes2
answers72
viewsHow to include dates even if there is no data
I need to make an appointment at the bank where I count how many vehicles passed in a date range. The code I’m using is this: select date(data), count(if(axlNumber = 2, 1, null)) as eixos2,…
-
1
votes1
answer181
viewsHow to avoid access to the database?
The perfect world would be that no user (company employees) had access to the production bank and this is my goal, only I do not know what the steps to get to this point. Today the devs have a…
-
1
votes1
answer1434
viewsHow to execute a command in CMD or Powershell, passing the commands via C#?
I need to execute a command on CMD that I pass the parameters via C# for example: "C:\Program Files\MySQL\MySQL Workbench 8.0 CE\mysqldump.exe" --column-statistics=0 -uroot -p1234 -hservidor -P3306…
-
1
votes1
answer102
viewsPDO execute returns true but does not insert
I am trying to enter a record in the bank using this code: $sql = "INSERT INTO tb_ConteudoExtra (Titulo_ConteudoExtra, Texto, Id_TipoConteudoExtra, Data, Hora) VALUES ('".$nomePagina."',…
-
1
votes2
answers66
viewsShow only larger records two days before today
I have the following Query in MYSQL: SELECT id_tabela,titulo,data_gabarito,left(data_gabarito,10) AS d_gabarito FROM tabela WHERE data_gabarito RLIKE('^[0-9]{2}/[0-9]{2}/[0-9]{4}') ORDER BY…
-
1
votes1
answer363
viewsSELECT INNER JOIN using PHP foreach in Datatable
I’m working on a CRUD using Datatable where it shows me data from 3 related tables where these three tables two are related to one. In case the PHP code is executed to fetch and display the data in…
-
1
votes1
answer292
viewsLaravel informs that the page was not found: 404 on the master/test route
How to make this update work? Below page code. Form_edit.php <form role="form"> <div class="box-body"> <div class="form-group"> <label>Name</label> <input…
-
1
votes4
answers199
viewsPHP Create dynamic array from one SQL and Separate by a specified amount of record in another Array
Boa Galera I’m New in PHP and my Logica this Bad D+ I need to select (SQL) a list of Offerings and separate Offerings from 6 to 6 and then create the array containing the 6 Offerings Ids. Code: //…
-
1
votes2
answers822
viewsImport data from a mysql table
I have a database Mysql and I am trying to import the data from a table that the customer passed to my default table. Using the script below, no error appears, however import is not done, table…
-
1
votes0
answers88
viewsI’m unable to do INNER JOIN in cakephp
All right, guys? I’m using cakephp to make a system that interacts with some database data from a Wordpress site however every time I try to perform an Inner Join cake query shows me this error:…
-
1
votes1
answer41
viewsError while performing Mysql update with composite keys
I have the following table in Mysql I tried all the ways to perform an update sql but every time returns the same error below. Cannot add or update a Child Row: a Foreign key Constraint fails This…
mysqlasked 5 years, 9 months ago user129333 130 -
1
votes0
answers1080
viewsPHP & SQL - A failed connection attempt - XAMPP
Hey, guys, here’s my problem. I own my machine with a Mysql localhost, there is a website that I created, however, when I try to connect the DB of the site with another machine that is not connected…
-
1
votes0
answers77
viewsValidation multi-company mysql relationship
Problem: a company can associate records that are not hers, just informing the id in the relationship Setting: My API is multi-company and each company manages its records (products, orders ...),…
-
1
votes1
answer74
viewsSet colors in Google Geochart Laravel?
I’m trying to define the colors of the Brazilian states, which are coming from mysql via json the information, but I’m not having resulted in the return of colors. Ex.: São Paulo in color Blue -…
-
1
votes2
answers1507
viewsHow to update a password in MYSQL and encrypt it
So guys, I want to do the following, I have a site that contains users and such, but when a user wants to change his password I want it to be encrypted to BD, how can I do that? when the user is…
-
1
votes1
answer102
viewsSelect in 2 tables
PHP PDO Mysql The question is the following, I have two tables, one calls groups and the other membro_groups, I will give a summary in the tables, I can take the groups and show how many users each…
-
1
votes1
answer79
views -
1
votes0
answers27
viewsMYSQL - Query to bring the best-selling plans and courses, with different groupby
I sell subscriptions to my course online, and also the courses separately. I’d like to bring the top 5 best selling plans/courses. For this, I have a table called subscriptionPlan, who guards the id…
mysqlasked 5 years, 9 months ago Maykel Esser 598 -
1
votes0
answers297
viewsDynamic table in PHP
I am developing a system for call tracking and teachers need a report where it will be possible to view the students of the class filtered by discipline, where it will be displayed if the student…
-
1
votes1
answer125
viewsCreate Table with 3 rows then create another table with 3 more rows
I would like to create several tables with three lines each. Example: GROUP A TEAM 1 TEAM 2 TEAM 3 GROUP B TEAM 4 TEAM 5 TEAM 6 Follow my code: <?php include 'masterpage.php'; include…