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
answer88
viewsFix Sum result php mysql
Code used to obtain the result <?php $total = 0; while($row = mysql_fetch_object($trabalho)) { $total += $row->valor; echo…
-
-2
votes1
answer259
viewsControl virtual store stock
I am in a virtual store project and I have a question about the stock control process. Initially I’m doing everything on the table product where I have two camps: manage_stock and stock. Manage…
-
-2
votes2
answers287
viewsDecrease a Mysql value
Is there any Mysql attribute to Decrement Day , month , year or time in the database itself that would be automatically. Ex: column-> starting value = 15, after a day would be 14 The mysql…
-
-2
votes1
answer23
viewsFriends, how do I view only one user with this rule
I would like to take the user id and price related to that user and just show a result referring to this user. Ex. I just want to see Mauro. <?php // Conectando ao banco $db_conx =…
-
-2
votes2
answers59
viewsMerge variables and include 0 to an 11 digit php field
I’m generating a bar code,: Number of the shop: $v_ficha_loja = $row['ficha_loja']; = (1)or (2)etc.. Number of the environment: $v_ficha_ambiente = $row['ficha_ambiente']; (1)or (2)etc.. And a…
-
-2
votes1
answer133
viewsTable with variable size in HTML
I need an HTML table to be powered by a database but the amount of data is variable. The number of columns is fixed but the number of rows may vary. It is necessary that the table fits the volume of…
-
-2
votes1
answer1133
viewsHow to recover Mysql database tables with corrupted operating system?
I owned a site installed on apache with windows server 2016, gave a problem in which the system got corrupted, but the files are there, the backup that I have of the bank and a week ago, only that…
-
-2
votes1
answer71
viewsindex.php blocking server
Good afternoon, I downloaded a free PHP script with open source and put in my server folder But when entering the index.php page it opens normal, but when opening again it does not load and gives…
-
-2
votes1
answer483
viewsListing and Counting Rows from a table in Mysql
I am trying to make a list of users who have logged in and at the same time a count of how many times each user has logged in, from log logins in a table, I can not explain very well, so will an…
-
-2
votes1
answer143
viewsHow to work in the same database by Workbench and terminal?
I created a database by Workbench But I can’t find it through the Mac terminal. How to work in the same database? How to locate the database created by Workbench? And vice versa... I’m connecting by…
-
-2
votes1
answer76
viewsRunning PHP commands saved in Mysql
I would like to know how to save and execute PHP code saved in my Mysql database. I have already created a basic structure for registering instructions. My question is about how to manipulate the…
-
-2
votes1
answer740
viewsDelete table record with foreign key
Where is the Error? DELETE FROM postagens WHERE id='$p_id' AND u_id='$u_id' SET FOREIGN_KEY_CHECKS = 0; Clarifications: p_id = id of posts(primary key) u_id = user id(foreign key)…
-
-2
votes1
answer43
viewsMerge two sql commands
Ola would like to join two SQL commands, which are: SELECT DATE_FORMAT(data_os, '%d/%m/%Y %H:%i') FROM tbos and: SELECT* FROM tbos WHERE os =…
mysqlasked 6 years, 7 months ago eduardo castro olivira 7 -
-2
votes2
answers68
viewsCreating Mysql user safely
For security reasons, what privileges a database user should or should not have?…
-
-2
votes1
answer444
views -
-2
votes1
answer207
viewsMy code does not error, but neither does it compile. Nothing happens :/
I do not know what happens in the code. It does not error, but also does not Insert and does not go to the Login screen and also does not enter the "error"…
-
-2
votes1
answer38
viewsI can’t get the date on the chart
I’m doing the following command: SELECT h.h_dia FROM hh h WHERE h.h_dia = 20180621 GROUP BY h.h_dia
-
-2
votes1
answer86
viewsHelp with Mysql connection
I’m creating a CRUD system for practices, and my code is making a mistake in mine prepare(). Index.php <?php require_once 'core/init.php'; // Abre a conexao com o banco de dados $pdo =…
-
-2
votes1
answer3581
viewsHow to create page for each user with PHP?
Today I saw a question from the.Sx user about creating a reference system, the question was disabled because it was with ZERO of details of what he wanted but I believe I got the idea, but as it was…
-
-2
votes1
answer295
viewsYou can’t specify target table 'pessoa' for update in FROM clause
I am testing the operation of a subquery (subconsulta) and executing the command below: DELETE FROM pessoa WHERE id IN(SELECT id FROM pessoa WHERE id=2 ); the following error occurs: You can’t…
mysqlasked 6 years, 2 months ago gai sensei 3 -
-2
votes1
answer31
viewsCheckbox loaded from the bank
I’m having a difficulty executing a logic, I have a table in the database that saves the values of an array, takes the values of one or more checkbox selected and saves with # separating the…
-
-2
votes1
answer18843
viewsHow to sum all values of a column in Mysql?
How do I add all user points? For example: ID | NOME | PONTOS 1 | Joao | 100 2 | Bia | 50 It is known that the sum of all the points in the database is 150.…
mysqlasked 6 years, 2 months ago Carlos Barros 25 -
-2
votes1
answer71
viewsDoubt to count records in a Mysql database query
In a Mysql database, I have two varchar columns that bring me records in this format: ["165","184","192","209","242"] One more example: Each number in double quotes is a record, IE, is the ID of…
-
-2
votes1
answer190
viewsPHP script for counting comma-separated records
In the databank I have a column that takes strings in this format: ["87","12","67"] What I need is to count each value separated by comma and assign to some variable, remembering that there are more…
-
-2
votes2
answers129
viewsHow to display id as form counter
I’m creating a form counter and I’d like to know if I’m going the right way ? This is my select query <?php error_reporting(-1); ini_set('display_errors', 'On'); //Criar a conexao $link = new…
-
-2
votes1
answer351
viewsCannot add Foreign key Constraint
Help with error in MySql create table cliente( endereco varchar(256), codigo integer primary key auto_increment, telefone varchar (18), tipo varchar(20) ); create table fisica( cpf varchar(20),…
mysqlasked 6 years, 1 month ago Marco Antonio 27 -
-2
votes2
answers36
viewsPolular select component in html page with data coming from table
I have a php variable that has its value. ex: "AREA 05" This is displayed in the input. I have a table that is related to the logins according to these areas. As I do and if it is possible to use…
-
-2
votes1
answer151
viewsSending php/jquery data to mysql
How could I send the data from the index.php screen to mysql , being that the javascript/jquery was used to do this function that is being shown in the image below. my code is below : My index…
-
-2
votes3
answers133
viewsUpdate in database not working
Man update in the bank does not work, follows codes: php student. <form method="post" action="?acao=save&id_aluno=<?php echo $id; ?>"> <?php echo $pegaid; ?> <input…
-
-2
votes3
answers659
views -
-2
votes1
answer51
viewsContinue searching in Mysql after given ID
Good night, I would like to know how to continue a search in Mysql, through PHP ($mysqli->query()), example I performed a search and found a user ID 1584, and I want to search another, but…
-
-2
votes1
answer397
viewsSearch an image in a Mysql database with php and then save that image to another table in the same database
I am making an application to save images, when the user does not choose any image is saved in the database a default image that is selected in another table of the database, but when saving the…
-
-2
votes1
answer1420
viewsShow Mysql query result with Echo (PHP)
I have a script in PHP and Mysql that has a query responsible for counting how many records (clients) are inserted in one of the tables of my database. However, I need to show the amount of records…
-
-2
votes1
answer131
viewsPdoexception error
Hello, I’m having difficulties in hosting a php system, initially I developed with xampp (localhost), however, when host is not making the Mysql connection for what I understood.. Error: Exception…
-
-2
votes1
answer65
viewsDatabase query with java
I will make a comparison with my problem using a database functionality and html Jquery. With Jquery we have the possibility to visit the database and bring the data to the frontend in HTML, and…
-
-2
votes1
answer1084
viewsUpdate in the database via javascript
I need to make a button that when the user clicks on the corresponding row he will execute the following code without refresh: Line Code: mysql_query('UPDATE tbl_publicacao SET status = S WHERE…
-
-2
votes1
answer237
viewsI cannot connect the Mysql Nodejs database
It should show the table data on the screen, but does not return anything. Where I am missing? module.exports = function(app){ app.get('/noticias', function(req, res){ var mysql = require('mysql');…
-
-2
votes2
answers250
viewsMysql - INNER JOIN - INDEX
Guys, I got one query here very simple with JOIN, Because banks have a lot of records, I need to index... But I’m getting it for kct... What is the best way to index in a JOIN? (That one query takes…
-
-2
votes1
answer33
viewsReorder AUTO_INCREMENT correctly
Hi, I need to reorder the field AUTO_INCREMENT in the Mysql to stay in the correct sequence. Searching, I managed to do it but when I enter a new record, it gets the Id continued from the previous…
-
-2
votes2
answers49
viewsData not saved in php database
I have the following code of a form so that the client can give his opinion, in navigating it shows success message, but does not record in the database. someone can help? <?php $Nome = $_POST…
-
-2
votes1
answer43
viewsWhat does this cursor/pointer syntax mean in SQL?
What does this SQL cursor/pointer syntax mean? SET @OLD_SQL_MODE = @@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,…
-
-2
votes1
answer31
viewsSubtract -1 from the mysql field’s own value
In a table field of the integer type stores the quantity of items in stock, when I lower, I must give -1 of the field itself, how to do this straight from mysql? Is that correct? UPDATE `tblQtd` SET…
-
-2
votes1
answer583
viewsTake database specific data
Good guys, I’m doing a project with the following pages pedidos.php and anexa.php. The action of the requests goes to the attached page, in it I have the sending of the content to the database and…
-
-2
votes2
answers47
viewsI a select where the same is starting to get too slow, Would you have any solution to improve your speed?
SELECT pessoafisica.PessoaFisica_Nome, filiados.`Filiado_MatriculaEmpresa`, filiados.`Filiado_RetornoSiape` AS observacoes, Filiado_MatriculaEmpresaDigito, lotacao.Lotacao_Descricao, (SELECT…
-
-2
votes2
answers78
viewsComparison of php dates
Good morning friends! My goal is to compare two dates in PHP. I want to check if $data1 is 24 hours longer than $data2. How do I do this? Thank you!
-
-2
votes1
answer94
viewsI’m having trouble saving input data to a mysql table via PHP
I’m trying to understand why I’m making a mistake at the moment I will save the entered data to us input in a mysql table via PHP? does anyone know how to solve? <?php require_once…
-
-2
votes2
answers260
viewsLog-in to mysql only with sudo
When I’m at the linux terminal, on my machine and give the command : mysql -u root -p The linux terminal presents : ERROR 1698 (28000): Access denied for user 'root'@'localhost' With sudo before the…
-
-2
votes1
answer57
viewscode appearing as text
I’m trying to insert a table but when I add it, it keeps popping up my code like it’s a text, but it works lol. Does anyone know what’s wrong with my code that I can’t find? <?php…
-
-2
votes1
answer90
viewsHOW TO CALCULATE PERCENTAGE WITH MYSQL
ID tiposang 1 A+ 2 A- 3 B+ 4 O- Good evening ,I’m doing a project and in my database I have a table similar to this one above, i would like to know how I do to perform a query that shows the…
-
-2
votes1
answer1008
viewsVIEW DATE BY PHP SPELL
Guys, next.. I have a contract printing page where I need to convert the field date in full <?php echo $result->estado?> - <?php echo $result->data_contrato?> In the…