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
votes1
answer566
viewsView fullcalendar codeigniter events
Hello! I want to retrieve the events from the database and display them in the calendar. Can you help me to do this? So far I have the following codes: Model: Public function obter_noticias() { $sql…
-
1
votes1
answer1234
viewsInner John repeating data
I use a query using the Inner Join, only the problem is that it duplicates the results I have a table in mysql that is called produtos_destaque where the id_produtoDestaque is foreign key in the…
-
1
votes2
answers4479
viewsSafest way to encrypt passwords in Mysql ? And the easiest?
What would be the safest way to encrypt passwords in Mysql ? And the easiest way? I am using a mysql database, with the removal of the function PASSWORD would like to know another way to encrypt.…
-
1
votes1
answer1494
viewsTwo variables and a group by? PHP and MYSQL
I’m making a very simple private chat system (just between two people) with PHP and Mysql, Jquery and HTML/CSS. In the database, the table has the following structure: id (int) remetente (varchar)…
-
1
votes2
answers1268
viewsSearch in a table in Mysql with Java
I’m having trouble trying to get something on the table, I’m new so I did it the way I know. Button code: livros.setPesquisarLivro(txtLivro.getText()); try { modelo.setNumRows(0); for (ObjetoLivro c…
-
1
votes2
answers44
viewsError using Many to Many
I have a group of Users who have relationship Many To Many, to create this relationship I did a function beLongsToMany within the model Usuarios. But every time I call this function I get the…
-
1
votes1
answer44
viewsSelect a list of values and from that list, select the lowest value
I want to select the last 10 inserts of a table and among these 10, return the lowest value. It is possible to do this in a single query? Selecting the last 10 values: SELECT id_relevo FROM relevo…
-
1
votes1
answer44
viewsHow to view 2 tables within a mysql database?
I’m new with sql and php. is the following, I have an affiliate system that I need to bring a user’s affiliate list. for that use: <?php //traz os usuarios $query = sprintf("SELECT…
-
1
votes1
answer58
viewsError including more than one mysql data in intel XDK javascript with PHP
I’m using the following function: $( document ).ready(function() { var $server; $server = 'http://localhost/mobile/DatabaseXDK/database/www/'; $('#inclusao').on('click', function(){ $nome =…
-
1
votes4
answers683
viewsVery slow SQL command
SELECT funcionario.nome, foto.foto, count(*) total FROM venda, funcionario, foto WHERE venda.idfuncionario = funcionario.idfuncionario AND funcionario.idfuncionario = foto.idfuncionario AND gol = 1…
-
1
votes1
answer675
viewsPHP does not return database result
Hello, I have the following function: function makeLogin($user, $pass) { $pdo = new PDO("mysql:host=".HOSTNAME.";dbname=".DATABASE.";charset=utf8;", USERNAME, PASSWORD); $sql =…
-
1
votes1
answer66
viewscalculating date in update mysql
Good need to update my accounts that are past due more than 5 months, I wanted to do this directly in mysql. The update is like this: UPDATE contas SET baixa_valivade = true WHERE data_vencimento…
-
1
votes1
answer118
viewsSelect for a specific period in Mysql
I know that if I want to query the date 5 days ago, I use the following Query: SELECT * FROM Tabela WHERE Data = DATE_SUB(CONCAT(CURDATE(), ' 00:00:00'), INTERVAL 5 DAY); Or you want to go back two…
-
1
votes4
answers691
viewsHow to send form data to mysql?
I am trying to send the form data to mysql but give error Notice: Array to string Conversion in C: xampp htdocs Requested projects.php on line 16 The line 16 is this $sql="INSERT INTO…
-
1
votes1
answer4666
viewsHTTP (Post) Bad Request 400 - How to resolve?
I am making a pole, but my server is not emitting an error(400). Below follows the server code. const express = require('express'); const app = express(); const bodyParser = require('body-parser');…
-
1
votes0
answers168
views -
1
votes1
answer35
viewsError in SQL query
Hello I have a table in the database that in it are stored several times. I am making a query only that this giving error. Consultation: select proximo from (select localizacao.horario as proximo…
-
1
votes1
answer185
viewsENTER key save table instead of spacing
I have the following table to let edit directly on the grid: Her codes: Mysql table CREATE TABLE IF NOT EXISTS `php_interview_questions` ( `id` int(8) NOT NULL, `question` text NOT NULL, `answer`…
-
1
votes1
answer39
viewsVariable does not work in script
Gentlemen, I’m new here, and I’m unanswered as to what’s going on. I created a $rga variable to insert through a field, but it doesn’t work. This srcipt uploads a photo and resizes. From the…
-
1
votes1
answer41
viewsDoubt with sql on Laravel?
Today I have a query that is returning me duplicate data, I made the change of sql more needed to change it. As I can leave in the same structure of select(DB::raw? The current code looks like this:…
-
1
votes0
answers29
viewsExport BD content to a WORD table
Well, I was doing a job and I came across this situation: I need to export certain content to Word, but this content must be in a table of the same. How could I do a While to create the Rows and…
-
1
votes1
answer122
viewsRetrieve and Store the ID from a login screen to use on other CRUD screens
I am specifying as described in the title,recover an id from a select and store it to use on the screens of Crud,I tried to do but still not working thank you already help given,Thanks HTML Login…
-
1
votes2
answers1393
viewsReturn something in the query when there are no records
I am making adjustments in a graphics system, basically there is a query in the database to bring values and popular the chart, but when there is no specific record does not return anything from the…
-
1
votes2
answers43
viewsError when trying to calculate in fields of the same table in update mysql
I have the following table: DROP TABLE IF EXISTS `convenio`; CREATE TABLE `convenio` ( `codigo` int(8) DEFAULT NULL, `cpf` varchar(11) NOT NULL DEFAULT '0', `Nome` varchar(35) DEFAULT NULL, `valor`…
-
1
votes2
answers381
viewsHibernate connection problems with Mysql Database
Hello, I am starting my studies in Hibernate and I am not making a connection to the Mysql Database. Below is my code: import java.util.Calendar; import javax.persistence.Entity; import…
-
1
votes1
answer1133
viewsFatal error: Call to a Member Function num_rows() on a non-object
I’m looking for the total number of lines of a query but keeps giving this error, I’ve tried to use the function Row(), rowCount() and even check if found any results to return and still not reached…
-
1
votes1
answer1342
viewsHow do I take the auto increment ID using Mysql and PHP and use it later?
I am creating an API in PHP and insert. I need to take the ID created in this INSERT and use later. What I find material, it seems not recommended. Any solution? Thank you. My PHP: <?php…
-
1
votes2
answers159
viewsQuery mysql problem, what would be the best way to solve
Hello, I am trying to make a query for an order system for a restaurant. My tables are arranged as follows: I need to bring all tables (regardless of whether they have a request or not) if they have…
-
1
votes0
answers46
viewsIt is possible to get real-time data in a mysql database flock from my database and from Asterisk
I wonder how I can get the information from Asterisk bank in real time, in my bank only has after user turns off the phone there the information and recorded in the bank, but I wonder if it is…
-
1
votes1
answer199
viewsHow to group data per week in mysql
I am extracting some data and want to know some way to group the data per week. I am giving the SELECT and he’s bringing in last month’s data and I’m already grouping by day, but I need it by week.…
-
1
votes1
answer47
viewsWhat kind of relationship for this case?
I am a programmer beginner in C# and would like to help my company get off the paper, is an Ice Cream Factory. We make available freezers for clientes. I am developing a system that manages the…
-
1
votes3
answers1807
viewsHow to do something asynchronous with jQuery, search in Mysql with PHP?
I’m having a lot of trouble with this part. I want to simply do a database search and move on to my main program, this without giving a refresh. I know how to do all part of PHP and Mysql, however…
-
1
votes2
answers1651
viewsSelect with JOIN
How do I limit this query to listing only one image record? I have the table of real estate and the table of photos, the table of real estate has several records, and each record has several photos,…
-
1
votes1
answer33
viewsQuery mysql in phpmyadmin
Good afternoon guys, can someone please help me? I have two tables, Tabela1 and Tabela2, would like to enter the column data carro of Tabela2 in the column carro of Tabela1, but in their respective…
-
1
votes0
answers48
viewsLow memory after mysqldump
I’ve been observing that always after running mysqldump, the server’s free memory gets very low and is not released right away. The command I’m using is mysqldump --default-character-set=latin1…
-
1
votes1
answer702
viewsFilter PHP and Mysql year and month
How to bring record regarding month and year which user typed (the way below did not work)? function filtrarData($datap) { $sql = "SELECT * FROM despesas WHERE YEAR(data_pago) = ? MONTH(data_pago) =…
-
1
votes1
answer24
viewsSums and Reformatting db for a Datagridview
I probably did not draw up a correct title, but I will try to explain my very detailed question. I’m working with Windowsform at Visualbasic15 I need to make a form where I get data from a tb in a…
-
1
votes1
answer38
viewsList tables to make recommendations to the customer?
I have a table "likes", "commented" and "visited", each time a user likes, comments or visits a particular book on my page a record is inserted in the database for such: Table likes:…
-
1
votes1
answer38
viewsMysql Date_add ranges in the same PHP code
$sql2 = "UPDATE usuarios SET expira = DATE_ADD(expira, INTERVAL $diasc DAY, $horac HOUR and $minutoc MINUTE and $segundosc SECOND), expira_manutencao = '0' WHERE expira_manutencao = '1'"; I would…
-
1
votes1
answer326
viewsPython/Mysql- How to get the id of a table by comparing with two different
I have the following two tables as shown in the following image: I wanted for example comparing the username (session level of each user) remove their id. I have used the following query but it…
-
1
votes1
answer138
viewsjava.net.Bindexception: Address already in use /127.0.0.1:13444
Guys, I have an application running on intagrator and today the system crashed, seeing the logs I came across this error: java.net.BindException: Address already in use /127.0.0.1:13444 at…
-
1
votes1
answer1207
viewsMysql error 2002 connection refused
I hosted a website on 007gb.with and I’m trying to access my remote database but I get the message "Mensagem do erro: SQLSTATE[HY000] [2002] Connection refused Code: 2002 Fatal error: Call to a…
-
1
votes1
answer218
viewsSearch mysql by record creation date
I want to do a mysql search by date of creation of all records, IE, I want to show the record and the date it was registered. I’ve researched but what it always shows is the between but that’s not…
-
1
votes2
answers1093
viewsDisplay data on screen according to clicked ID
Hello, I’m having a little problem here maybe easy to solve, but I’m not getting it. I have a first screen (.php students) where will have several search terms, and one of them will be by study…
-
1
votes2
answers81
viewsHow to execute a function whose name is in the database?
I would like to know how to execute a Javascript function by taking its name in the database. Example: data["nome_coluna"] // essa será a informação que estará no banco. (exemplo: somar();) // Aí o…
-
1
votes0
answers101
viewsProblem running event with Mysql
Eai guys, all right? I’m having a doubt, I set up the following SQL CREATE DEFINER = `root`@`localhost` EVENT `ut_clear_cart` ON SCHEDULE EVERY 1 MINUTE STARTS '2018-11-20 00:00:00' ON COMPLETION…
-
1
votes1
answer74
viewsMYSQL, How do SELECT without grouping identical WHERE values?
Good Afternoon SELECT id, descricao FROM Produtos WHERE id IN ('1','1','2', '3','3'); But the result is id / descricao 1 / Caneta 2 / Lapis 3 / Borracha I wanted it to be according to the table…
-
1
votes5
answers632
viewsPHP that returns null table fields that are neither empty nor null in Mysql
I have a table "payment forms" and I made an API to get all these forms of payment, but even though the database is correct, it informs that the field "name" is null in return, see:…
-
1
votes3
answers1150
viewsHandling Foreign key errors in Codeigniter
I am implementing a code where there is a foreign key in two tables. Soon I tried several means and could not handle the error: Error Number: 1451 Cannot delete or update a parent row: a foreign key…
-
1
votes2
answers1020
viewsDelete record being duplicated in query with Inner Join
I am making a query to my database and in this query I use an INNER JOIN to join two tables! But I have a problem, because I do not know how to manipulate JOIN very well, and this is generating a…