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
-
8
votes3
answers3452
viewsWhat is an absolute value?
Viewing the Mysql documentation you can find the mathematical function ABS(x), to which the absolute value of x. mysql> SELECT ABS(2); -> 2 mysql> SELECT ABS(-32); -> 32 What exactly is…
-
8
votes2
answers10963
viewsWhat is the difference between SET and ENUM in Mysql?
What are the differences between SET and ENUM in Mysql? And in what situations both are best applied?
-
8
votes1
answer279
viewsWhat is the best type in SQL to use with Cryptocurrency?
I am developing a system where I will store transactions of Cryptocurrencies, type Bitcoin, I can not in any way have problems of conversion and rounding, in C# I checked and the best is decimal,…
-
8
votes3
answers182
viewsConvert date type 2016-10-04 15:51:16 to, 04-10-2016 15:51:16 to SQL or PHP how to do?
I’m doing a job to show the date and time of insertion in the script in the database, I have to show the date in the dd-mm-yyyyyy format and then the time, can I do it by the script’s SELECT or by…
-
8
votes1
answer1004
viewsHow to mount a SELECT to return the last status change of each id?
I have the following table: status_invoices id_fatura | status | data ---------------------------------------- XX-XX-XX | 3 | 2017-01-04 21:00:24 XX-XX-XX | 2 | 2017-01-02 11:10:20 YY-YY-YY | 4 |…
-
8
votes1
answer17973
viewsWhat is the difference TEXT and LONGTEXT?
I am developing a system where I will import the data from an Excel. As this data will be temporary, I intend to save the information of this imported column in format JSON at the bank. Therefore, I…
mysqlasked 7 years, 9 months ago Wallace Maxters 102,340 -
8
votes1
answer794
viewsPermission PHP file
I have a file PHP inside the Linux opt directory. Inside it I have a script with queries to update a database, with password and login connection of the database. This file is set inside a bash file…
-
8
votes3
answers799
viewsHow to sort by the relevance of Like?
I’m making an autocomplete that makes a request to a url, which in turn queries in the database. This consultation is made with the LIKE. I use %$termo% to be able to consult, but I would like to…
-
8
votes1
answer8579
viewsIs there a Timezone for Brasilia?
I am developing an app in PHP. And I need to set Timezone for Brasilia. However in the php documentation I have: $timezones = array( 'AC' => 'America/Rio_branco', 'AL' => 'America/Maceio',…
-
8
votes1
answer270
viewsResult when converting minutes to hours
I have a query where I have an example that gives the correct result and the other one does not when converting minutes to hours. 1st example in minutes: SELECT A.Colaborador, SUM(A.`Horas…
-
8
votes2
answers1771
viewsTurn columns into rows
I have the following structure: http://sqlfiddle.com/#! 9/738aa6/1 CREATE TABLE Viagem ( Idasemvolta int, Idacomvolta int ); INSERT INTO Viagem VALUES (64, 39) With the following select: select…
-
8
votes3
answers931
viewsHow to query with Count
I have the table Upshot with thousands of data, Table Result NOME_CASA, NOME_OPONENTE, RESULTADO_FINAL, NOTA_FINAL. timeAzul timePreto 1 2 timeAzul timeBranco 2 2.10 timeBranco timeAzul 3 2.20…
-
8
votes3
answers650
viewsWhat is the best way to build a Mysql table with recipe items? All ingredients in one row or one ingredient per row?
I’m used to creating websites with few database records, so I don’t care about the speed of query and I have no experience with large volumes of information. But now I am creating a website recipes,…
-
7
votes4
answers4319
viewsString concatenation in SQL
I perform a query in a table in my Mysql database that returns the following fields to me: usuarioId nome sobrenome idade sexo escolaridade modeloNome hora Follow the sql below: SELECT…
-
7
votes1
answer1549
viewsMysql query equal to one value or another
I’m having a doubt in a query mysql. I have this query select cor from cores where cor in('verde','vermelho'); The problem is that I want the green, and If there is no green I want the red. but not…
-
7
votes2
answers394
viewsGet inverse relationship with Laravel
I am creating a forum system that is divided by sections. Each section contains categories, each category contains topics. Ex: Administração _ |_Regras da do fórum |_Sugestões e críticas…
-
7
votes2
answers1761
viewsExchange impact - Myisam for Innodb
In a medium database (~2GB) Mysql that is all with the Myisam engine. Performing the conversion to Innodb, what will be the impact on my system? I can simply convert by phpMyAdmin, for example?…
-
7
votes6
answers5683
viewsCopy Wordpress database without using Phpmyadmin
I need to migrate a Wordpress site from one server to another. One of the necessary steps is to export the database used on the current site, edit some data if necessary (such as the site address…
-
7
votes3
answers408
viewsHow to index and update a user comparison system?
I have 2 tables with user characteristics and interests in a Mysql database with innoDB Tabela Carateristica id nome sobrenome cidade estadocivil altura peso fisico pele olhos filhos querofilhos…
-
7
votes3
answers3657
viewsHow to group records by time range?
I have a table in Mysql, which stores visits on my site, having as fields: id | ip | date, being the date of the kind DATETIME. What I need is to separate these visits by peak hours. Example: Das…
-
7
votes1
answer25983
viewsHow to run PHP file from Javascript function?
I have the following structure for registering a new Mysql database account (Register.php): <?php $con = mysqli_connect("meu_host","meu_user","minha_senha","banco"); mysqli_query($con,"INSERT…
-
7
votes3
answers7057
viewsSystem of infinite categories and subcategories/children
I’m putting together a system of infinite categories and subcategories, simple to begin with. I found a script on the internet that meets the requirements, but its customization and adaptation to my…
-
7
votes1
answer1593
viewsRelationship between state, city, municipality and district
I downloaded an IBGE xml file with data from states, cities, municipalities and districts. I separated it into 4 tables and made their relationships. Follow the Sqlfiddle My question is: It’s right…
-
7
votes3
answers7634
viewsError importing CSV into phpMyAdmin
I need to import a file .csv for phpMyAdmin, but the special characters do not appear, nor the text that follows them. What may be the problem?…
-
7
votes1
answer10316
viewsHow to fix Entityvalidationerrors
Hi, I need a help. After compiling my project I am getting an error: Validation failed for one or more entities. See 'Entityvalidationerrors' Property for more Details. I have already found that…
-
7
votes3
answers23785
viewsHow to make PHP and Mysql paging?
I want to make a pagination on my blog. I’m not going to have 50 posts on the first page, so I want to limit the page to the last 15 posts added and then by clicking on the "Older posts" button will…
-
7
votes1
answer2867
viewsBackup all tables except one
In Mysql we can perform backups via terminal as follows: Database mysqldump nomeBaseDados > meuFicheiroBackup.sql Table mysqldump nomeBaseDados nomeTabela > meuFicheiroBackupDaTabelaX.sql How…
-
7
votes3
answers1170
viewsHow do I count the amount of products per category?
I have the table tbl_produtos id_product product name cat_product I have the table tbl_categorias id_categoria category name How would I count the amount of products for a certain category, for…
-
7
votes2
answers2817
viewsMerge two tables with PHP
I have two tables in the database, one listing the posts and the other of registered users. Columns I have in the table of posts: ID || TEXTO || ID_USER || Columns I have in the user table: ID ||…
-
7
votes1
answer1894
viewsDynamic bind with prepare()
I am doing a function using PDO, when I try to use the PREPARE method the function does not end successfully, replace PREPARE with QUERY changing some arguments and worked. But my question is this…
-
7
votes3
answers2527
viewsHow to determine the sort of accented characters in Mysql?
My table uses "utf8-general-ci" so all accents are OK. But when I have for example Aa, Ac and Áb and I want to filter "in alphabetical order", the result is: Aa Ac Áb About Excel, the result is: Aa…
-
7
votes1
answer1339
viewsA Product in Multiple Categories - PHP
I would like to know how to relate a product in several categories ? For example: A shirt can be in the Categories : "Green / Blue / Yellow" and when I filtered by category the product should appear…
-
7
votes2
answers344
viewsSplit column into multiple tables
I want to save a set of information about movies in a database but I have a question, I must organize the genres in column (example below). Database: Mysql 5.6.21 Engine: innoDB or organize gender…
-
7
votes2
answers4428
viewsTable to record history record (Best way)?
I am doubtful what would be the best way to create a table so that each action of a record is saved thus creating a history of it. I have the following table, but I don’t know if it’s the best.…
-
7
votes2
answers1493
views -
7
votes2
answers18011
viewsINNER JOIN with two fields of the same table
I’m having a problem I haven’t found a solution to so far. I have 3 tables in Mysql: Units:containing information from "stores". Orders: contain the order information made by loja01 for loja02, both…
-
7
votes1
answer386
viewsMy calendar only displays the first scheduled appointment of each day
I’ve set up a calendar with a PHP + Mysql calendar , it’s already 80% of the development. But, I have a problem, like if I register for an event for the day 20/07, this appointment is displayed…
-
7
votes2
answers1310
viewsIs there any way to transfer Mysql data directly to an Excel table?
Is there any way to transfer all data from the database to a table in Excel? It can be with any language.
-
7
votes2
answers1186
viewsProblem connecting Mysql in Python 3.4
I just installed my virtual environment, installed Pymysql and created a project, however, when trying to start an APP python manage.py startapp nome, the following problem arose: Error loading…
-
7
votes4
answers9913
viewsDifference between prepare() and query()?
I was making a select in a table. I went to see the result, returned false. Then I used the query and it worked. What’s the difference between the two? <?php $query =…
-
7
votes2
answers1889
viewsMethods of image storage
I am studying what is the best way to store some images of users that are registered in my system. I found 3 ways to solve this problem: Save to local directory, Save as BLOB and Save as Base64. I…
-
7
votes1
answer815
viewsHow to set the maximum disk size of a database?
How to set the maximum disk size of a Mysql, Oracle, Postgresql or DB2 database? This is how I do in SQL Server: Create Database MyDatabase on (Name='MyDatabase_Data',…
-
7
votes2
answers2815
viewsDeleting data automatically after certain time
Example: I have a table with three fields: id int pk, varchar name, int category. The category field can receive 2 values: 1 and 2; By default always when a data is entered it will have a category…
-
7
votes1
answer245
views -
7
votes1
answer73
viewsGroup by with subdivisions
I have an SQL that brings the number of people who graduated on a given date. Let’s say that of 300 people, 25 graduated on '2010-06-27'. I would like to include two more columns that return the…
-
7
votes1
answer272
viewsFill in a collection type property
Good personal evening how to fill a collection property using this type of structure in a class: public class Order { public string orderNumber {get; set; } public DateTime orderDate {get; set; }…
-
7
votes2
answers975
viewsDatabase connection error
I’m having a problem connecting to Mysql database with PHP I’m using WAMP created a database in my Phpmyadmin made my connection via PHP but this error appears when I click to send in my form: These…
-
7
votes1
answer423
viewsTable does not appear in return Json
I’m trying to show a table on my return insert but I am not succeeding, the insertion operation is correct as well as the confirmation message, but the table is not displayed, I have it: function…
-
7
votes2
answers585
viewsListing error in paginated search system
When I do the query I get the following result [imagem1] By clicking to go to page 2, I get the following result [imagem2] That is, on page "1" everything working with the total results displayed…
-
7
votes1
answer726
viewsHow to insert returned value into form fields with jQuery?
Accurate, after consulting in BD insert returned values into fields of a form, as I will use these fields to make a change to the BD, the call to search is working correctly and is configured this…