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
-
3
votes1
answer4502
viewsDisplay (decimal) value without rounding
Hello, using a database mysql, with Asp.net mvc c#, have in the database the following value (of decimal type): 48.205864 So when I just make one select, and bring it to the screen, is displayed…
-
3
votes1
answer431
viewsHow to create validation to ask if the user really wants to leave the page?
I have a tab where the user will edit fields that are in a form. This data comes from the database. The user can edit them, however, in the end he can write (ie will write/update in the database) or…
-
3
votes3
answers1461
viewsProblems with PHP encoding in UTF-8
None of the solutions suggested in various forums, websites and the like worked. I performed several tests and none of them worked and so I came here. The website where the error occurs is this:…
-
3
votes3
answers210
viewsHow to create tables when starting Sisitema with JSF and JPA?
Guys, how do I make sure that when the system starts the tables you are created automatically? The way my system is, tables are only created when some kind of access to the bank is done. For example…
-
3
votes2
answers112
viewsHow to create XML tags from the column name of a mysql database?
How to create XML tags with the column name of a table coming from a myslq query? In the code I did I could only get the values of each cell of the table, but what I wanted was to create the tags…
-
3
votes1
answer57
views"n" be transformed into "<br>" automatically
I’m developing a PHP posting system with Mysql. I need the line breaks that user enter in textarea are converted into <br />. The variable $texto (contains the content of the post) goes to the…
-
3
votes1
answer1898
viewsHow to return only records without matching in a JOIN?
I have a question regarding the use of JOIN in SQL in this case: I have a table produtos and a table destaques containing the id product. I need to make a query that returns only the records that…
-
3
votes1
answer5798
viewsInsert into table if not available
How to insert data into a table only if it does not exist? the following attempt returns an error, the basic idea is to insert a mode record unique,if already existing ignore, otherwise enter the…
-
3
votes2
answers2725
viewsHow can I check if a table is empty?
I want to check if a Mysql table is empty (with no record) with PHP, how can I do that? What kind of consultation do I make to make sure of that?
-
3
votes1
answer3448
viewsMysql Workbench - error unserializing grt data
An error appears to me when opening a project in Mysql Workbench. error unserializing grt data
-
3
votes1
answer52
viewsReplace in update, change extension in filenames
I have a table with images, images, in which one of these columns (file_name) has names of pictures, some jpg others png, what I need is to change, to make UPDATE all to the extension png, that is,…
-
3
votes0
answers388
viewsData structure for setting up shop opening hours
First of all, found that doubt, which in fact is similar, but did not seem to involve some criteria I need, such as opening hours after midnight. I’m developing an app where I need to show the…
mysqlasked 9 years ago celsomtrindade 8,038 -
3
votes1
answer269
viewsPIVOT - SELECT reversing row and column
I have a table like this: codigo ano quant 100 2014 15 100 2015 13 100 2016 20 101 2015 15 102 2016 22 102 2014 05 I want to create a query that lists me the code like this: codigo 2014 2015 2016…
-
3
votes2
answers937
viewsHow many tables does Mysql support?
Well, what I want to do is create a table in my database for each user, now my question is: How many tables does Mysql support? Will put enough tables my server does not lock or gives some bug? Is…
-
3
votes2
answers105
viewsCheck if the same value is in one of the two fields
In a system of login, I want the user to enter the "user" or "email" that is contained in the DB. This works perfectly: DBRead('usuarios', "WHERE usuario = '$user' OR email ='$user' AND senha =…
mysqlasked 8 years ago Daniel Bonifácio 951 -
3
votes1
answer504
viewsMysql select Random with priorities
I have the following scenario, I have a table and I need to select an order by RAND(). But I would like to put some conditions for example: TABELA ID | NOME | IDADE | GRUPO Dice 1 | Hiago | 20 | 1 2…
-
3
votes2
answers190
viewsHow to pass company id to employee table?
I have a company table and another employee. Company table: id_emp | tipo | documento | fantasia | email | celular | senha | data_cadastro | ativo Example: 1 | pessoa juridica | 05.142.333/0001-21 |…
-
3
votes2
answers210
viewsSum if in Mysql Workbench
I have a database in Mysql. No_Pedido|Valor|Cortesia 123|1000|Sim 123|500|Nao 124|200|Nao 124|500|Nao I need to make a select that returns the sum of the value per request that is not courtesy,…
-
3
votes2
answers1278
viewsSelect with Inner Join with Cakephp
I have a little problem for some time regarding a project that I am developing in cakephp, mine view can’t read a select with Inner Join table. Controller: public function initialize() { $posts =…
-
3
votes0
answers137
viewsError Connecting in Mysql PDO
My MAC disconnected out of nowhere and when connected again stopped working Mysql. Mysql is installed by MAMP. Is giving this error when accessing only one website: SQLSTATE[HY000] [2002] Can’t…
mysqlasked 8 years, 12 months ago Diego Souza 16,524 -
3
votes1
answer480
viewsRecover Mysql data and save to a vector
Rephrasing the question.. I have a Mysql database, inside it contains a table called map, inside the table map I have the fields idmapa (auto_increment), lat (which stores the latitude of a map…
-
3
votes3
answers499
viewsHow to force the reading of all existing REST results on a page?
foreach ($result as $indices) { // Aqui ele retorna 50 registros por conuslta echo $indices['Empreendimento']; // Provavelmente preciso de um loop da paginação aqui dentro // para falar para o…
-
3
votes1
answer368
viewsFormat date in INSERT and UPDATE Mysql PHP
Well I have a registration Gride with date, only I have to use a Mask of Jquery: $(document).ready(function(){ $('.date').mask('00.00.0000'); }); But when I do an INSERT, for example, the date…
-
3
votes1
answer577
viewsHow to install a java application with a Mysql database?
I am developing a java desktop application, with java swing and Mysql database. But I need to install this application on several machines and I would like to know an easier way to do this, without…
-
3
votes1
answer55
viewsAdd Wordpress user in more than one function
I am developing a plugin for member area in Wordpress and I will control this access through the functions (roles). Suppose I create the functions: content1, content2 and content3. How I could…
-
3
votes1
answer201
viewsMysql query ranges
I need to assemble a select, where I need to display the results outside a code range. For example: I have code 2 as the beginning and code 6 as the end, how could I not display the codes 3, 4 and 5…
-
3
votes2
answers59
viewsTable of users with same usernames
In a Mysql database table, I have new user registration, and the primary key of the table is an ID field. However, I may end up creating, even by accident, users with the same username. For example,…
mysqlasked 7 years, 12 months ago Gustavo Hoppe Levin 795 -
3
votes1
answer89
viewsHelp with MYSQL TRIGGER
I need to assemble a Trigger that before deleting a user it checks if there are occurrences linked to the user in question, and if there is, not allow delete, but never worked with Triggers. Someone…
-
3
votes2
answers606
viewsSave image array to different columns
Good night. I would like to count on your help in solving a problem that has been grinding my molecule for a few days and I have not yet been able to find a solution. I have the following code to…
-
3
votes1
answer21
viewsHow to save form data only if it comes from a particular website?
Hello, I have a form that is being used on another site and saving in my database, through a php action that is on my server. But I would just like to save the data if the form comes from the domain…
-
3
votes1
answer1016
viewsError " Duplicate entry '1' for key 'PRIMARY' "
Good guys to with the following problem , when entering the data in a table I automatically insert the same data in the other two tables , but just right in the first row that I insert , when I…
-
3
votes2
answers1260
viewsHow to insert all array values and avoid $query->execute() with each foreach run?
How to insert all array values and avoid $query->execute() to each execution of the foreach? $_POST = json_decode(file_get_contents('php://input'), true); $sql = "INSERT INTO teste(nome, email)…
-
3
votes2
answers457
viewsHow to work with PHP authorization levels?
I’m putting together a school bulletin system to train my skills in php. And I’m struggling in one part. Here’s the thing: I have 3 types of users: teacher, admin and student. The teacher can put…
-
3
votes2
answers458
viewsFiredac: Getfieldnames without quotation marks
I’m recovering the table fields Firebird and Mysql for Firedac Connection via the command line GetFieldNames, however some fields of the list are returned with quotes. I have tried to insert the…
-
3
votes2
answers1099
viewsreplace id by name
Good guys I have a table called sale and in this table I insert some data from other table up to there all blz , my problem and at the time of showing this data when I echo a screen does not appear…
-
3
votes2
answers74
viewsHelp with JOINS in 3 tables
I found a tutorial talking about JOINS and implanted in the survey for sales made. But it was almost all right, only at the time of the search for the sales code, instead of bringing me only the…
-
3
votes1
answer3228
viewsProblems with entering data in the float field in MYSQL
I have a problem when inserting a value in a field in the table, this field is like float(15,6). I ran an Insert here INSERT INTO valores (valor) VALUES ('1160.480000'); Why it inserts the value as…
-
3
votes2
answers141
viewsSort Mysql results using two tables
is the following, I have two tables, a so-called topical and other comments(which has a foreign key from the topical table), I wanted to list the topics by sorting them by the amount of comments…
-
3
votes2
answers10959
viewsHow to select between dates
My question is quite simple, I intend to ask a SELECT between dates, from a given table, where the status='1'. I mean, I have for example: $data1 = 13/01/2017 $data2 = 20/01/2017 I want to select…
-
3
votes1
answer215
viewsAssemble news by grouping results by user class
I am developing a news system where a certain user class will be able to post one or more news for everyone to see it works perfect, more for a better view would like these messages to be grouped by…
-
3
votes4
answers1125
viewsRun PHP function to insert data into DB daily at specific times
I am creating a "module" of my system and now I have to create a function that, when arriving at the time that is in the database, run a insert. For example, if the schedule is in the table 22:00,…
-
3
votes1
answer350
viewsEntity Framework: Data Model with column with the largest number of characters possible
I’m creating the tables with the Entity Framework, and I’m using the Data Annotation to determine the amount of characters, I wanted to know which larger size was supported for typing text and…
-
3
votes2
answers328
viewsWhat would the query look like to return values in a given range?
I have a table with the following Rows: code (int) vaccine (varnish) dt_maturity (datetime) I need a query to return all vaccines that will win in the interval of 10 days, counting today’s date. I…
-
3
votes1
answer1181
viewsTable size does not decrease
A mysql table had 10.2Gb of data, I ran a script that deleted old data that was no longer needed, After erasing half of the data from this table, it still continues with 10.2Gb. Consuming my server…
mysqlasked 7 years, 10 months ago Pedro Augusto 2,392 -
3
votes1
answer775
viewsHow to convert latin1_swedish_ci data to utf8_bin in php?
I got an SQL script that "mounts" 3 tables, one with country, one with states and one with Brazilian cities. The script makes the collection, of the names, in latin1_swedish_ci and I needed it to be…
-
3
votes2
answers78
viewsDifficulty to query in Mysql
First I’m starting now to mess with mysql I’m very lay in the subject yet I have a table called products_search_items and this table has 2 columns a product_i" and the search_item_id I needed to…
-
3
votes0
answers39
viewsPHP: query with Latin characters returns nothing
Hello, I am writing a code from a page that will make a query in a database using data in a form with two inputs: matricula and name. The idea is this: If the user does not enter anything and click…
-
3
votes1
answer288
viewsProblem in foreign key creation
I’m having trouble creating a foreign key from these tables: Code: ALTER TABLE `tb_permissao_view` ADD CONSTRAINT `fk_tb_permissao_view_tb_sistema_pagina` FOREIGN KEY (`cd_pagina`) REFERENCES…
mysqlasked 8 years, 10 months ago Vinicius Miranda 33 -
3
votes1
answer293
viewsCreate a download link for path that is in mysql
I have the following structure in the database: reuniaoId escolaId usuarioId dataReuniao tituloReuniao pathReuniao 7 14 1 2016-01-13 AEQEQ uploads/reuniao/ata_2016_2418530_2HK73386F.pdf I need to…
-
3
votes1
answer883
viewsHow to convert values from one column to UPPERCASE
Using Mysql commands, it would be possible to convert all values from one column to UPPERCASE?
mysqlasked 7 years, 8 months ago lucasbento 856