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
votes2
answers879
viewsPHP - How to make left Join with more than one record in the other tables not return repeated values in the columns?
I need to perform an SQL query in PHP, where I need to create a table from 9 other tables, joining all the columns with a LEFT JOIN, and with the 'Client' field as key between the tables. However,…
-
2
votes1
answer296
viewsContent migration between different post types in Wordpress
Good morning, I am currently working with a project for a news portal that is the grouping of 4 different companies, but one of these companies will cease to exist and all its posts will be…
mysql sql wordpress phpmyadmin wordpress-pluginasked 8 years, 10 months ago Lucas Bernieri Ramos 143 -
2
votes0
answers64
viewsWrite data to the database
Hello, I have a javascript function that adds fields in my form. And I want to save the values of these fields in my database. The field code is these. <div><input type="radio"…
-
2
votes1
answer86
viewsHow to give permissions to all Mysql users at once?
I have a database that all Mysql users should be able to access. I’ve tried a GRANT ALL PRIVILEGES on nomedobanco.* to '%'@'%' identified by, but without success. How can I do that?…
mysqlasked 7 years, 9 months ago Wallace Magalhães 1,242 -
2
votes3
answers425
viewsGet the first 3 results in a query mysql_query
I’m retrieving data from the database that would be "The Nominee’s Indicator," only it takes them all until it recovers all. What I need to do is get only the first 3 results. And if I can indicate…
-
2
votes1
answer561
viewsAdd X days on a predefined date in Mysql
I need to create a deadline, an access expiration date in the case I am using to capture the current time the "criado" datetime DEFAULT CURRENT_TIMESTAMP, Where I use the CURRENT_TIMESTAMP to get…
-
2
votes2
answers1623
viewsQuery delete with Join mysql
People I have problem with this query do not know what is wrong: DELETE FROM mdl_forum_discussions WHERE id IN ( SELECT mdl_forum_discussions.id FROM mdl_forum_discussions LEFT JOIN mdl_forum_posts…
-
2
votes1
answer476
viewsAJAX appear Divs according to database ID (MYSQL)
I’m trying to do that every time I squeeze in #buttonIdUltimoItem a structured DIV appears taking information from database from the younger to the older according to the ID. The problem that…
-
2
votes1
answer5886
viewsHow to place the current date and time in a datetime field?
I have a field date in a table that is of the type datetime and I want to put there the current date of my server. I’ve tried everything with NOW() in the insert SQL, but then I saw that it doesn’t…
-
2
votes1
answer1331
viewsSending data via Link (POST or GET)
Good morning my dear, I’m new around here... First of all, I want to point out that I have read the topics that exist in this forum and I could not solve my problem! My problem is to send only the…
-
2
votes1
answer582
viewsEnter and search data in the database per user with Laravel
I need to save information in the database per logged-in user. That is, when the user logs in, everything he does will be saved in the database of that login. That is, when user X logs in,…
-
2
votes0
answers230
viewsMysql multiplication between decimal type values loses accuracy
In my application I need precision for numerical values of 12 decimal places. I created the following test: CREATE TABLE TESTE ( VALOR1 DECIMAL(16,12), VALOR2 DECIMAL(16,12), VALOR3 DECIMAL(16,12) )…
-
2
votes3
answers100
viewsSearch first name in mysql field before MYSQL space
I have to look for a date in a mysql field, but the guys had put it to save like this "2016-02-21 14:02:01" I just need the date from there , as I can check on select the date I want comparing to…
mysqlasked 7 years, 9 months ago Rodrigo Luan 385 -
2
votes1
answer255
viewsMysql result coming with bars
I’m using the http://summernote.org/, and when I send something to the database, for example, if I add this HTML tag <img = src="http://link"> in the editor, and send to the database, it saves…
-
2
votes0
answers41
viewserror in content registration
This is my first post so sorry if you do anything wrong if I violate any rule please let me know. my doubt is as follows: I am creating a "social network" and the post code is not working I used the…
-
2
votes1
answer1233
viewsLeft Outer Join does not bring Null values
I have two tables: formulario_campo ( cod_campo, descricao, cod_formulario ) Filled with the following values - input_nome, Nome, 1 - input_sexo, Sexo, 1 The second table: —…
-
2
votes1
answer123
viewsRename multiple files with VB6 Database data
I have a table with the following columns ID, Cod and Nome, I have a folder with hundreds of images, these images are with the beginning of the name equal to column Cod table, that is to say: Cod…
-
2
votes1
answer55
viewsPDO exec returning false
I’m doing an online course on PHP with PDO and I’m having problems right in the first class with the code: <?php $pdo = new PDO('mysql:host = localhost, dbname = curso_php_oop', 'root', '');…
-
2
votes1
answer656
viewsUsing last_insert_id(), is it credivel if several users enter at the same time in the database?
I have a doubt about the method last_insert_id() mysql. And the following: I am creating a procedure to insert into 3 tables, example: person (idPessoa, surname,) employee(idEmployment,idPessoa,)…
-
2
votes2
answers1410
viewsAlternative to Mysql Workbench
Well, I currently use Mysql Workbench software to do my scripts, wanted a lighter program, someone knows/could pass me some alternatives? I don’t want PHPMYADMIN Note: I develop with PHP - I don’t…
-
2
votes1
answer1682
viewsError 404 Not Found (Nginx)
I have a blog and for a few days it started to give the following error in some pages. 404 Not Found nginx/1.6.2 (Ubuntu) The error log is returning: 2016/02/02 10:44:12 [error] 612#0: *553172…
-
2
votes1
answer375
viewsUpdate in a table with values from another
How to update the values of a table, using values taken from another table: UPDATE produto -- atualizar a tabela produto SET produto.quant = SUM(entrada.quant) -- produto.quant será igual a soma da…
-
2
votes0
answers74
viewsStore time in TIME type field greater than 838:59:59 in Mysql
Good afternoon, Could someone help me with this? I am in need of storing values longer than 838:59:59 in the TIME field in Mysql. Is there any alternative for the TIME type to be able to store value…
-
2
votes2
answers123
viewsDate to String to Pyhton conversion
I’m trying to get a date of this next select in python select MAX(PAYMENT_DATE) from fact_cashflow WHERE DOCUMENT_ID = 'SALDO FINAL' and PAYMENT_AMOUNT > 0 But my answer on the console is this…
-
2
votes1
answer253
viewsPHP Mysql - return of duplicates
Good staff my question is the following: How can I be doing the check to know if there is already such value in the database? I have this code here that is already checked by SQL Query itself, ie if…
-
2
votes1
answer236
views"Fine tuning" in SELECT for a ranking system
I’m having difficulties using Mysql. I’ve been asking here already, and I’ve done several tests and progress in the elaboration of a select for a ranking. I have a "player" table that guards among…
-
2
votes3
answers1436
viewsMysql - merge results from multiple columns
I have a Mysql table where I need in a single result fields that are in 3 different columns. I’ll give an example: Col.A Col.B Col.C Joaquim Sérgio Ricardo Ricardo Maria César Rafael Solange Joaquim…
-
2
votes1
answer97
viewsQuery of sectors in php mysql
Here I see how many questions you have in each sector: SELECT a.area_id AS ID_AREA, a.area_desc AS AREA_DESC, count(sb.sub_area_cod) AS TOTAL FROM relacaoperg AS rp INNER JOIN area AS a ON…
-
2
votes3
answers849
viewsHow to go through each row of the database compare and update a specific column?
I have a table called PRODUCT and I need to make a comparison between two columns, the column DATA_INICIAL AND DATA_FINAL, for each row travelled, if the product is not in agreement should enter the…
-
2
votes2
answers1461
viewsHow to insert query result in mysql with python
I need to enter in the database the result of this query through the temperature module. The code is this. Temperature and humidity are already returning, but not saved in the database the values. #…
-
2
votes3
answers394
viewsData Range Search in SQL
I have a table with the structure below I need to make an appointment with a certain interval in order to generate a report. I used the Between command... and with it it returns me the following…
-
2
votes1
answer803
viewsStart/End of Summer Time: problem with date verification of type "greater than"
Every year I have two problems, one when the summer schedule starts and the other when it ends. Anyway, yesterday the clock was delayed by an hour that created a giant problem. The page should allow…
-
2
votes2
answers662
viewsSet Auto Increment position, always for the smallest ID
I have a database Mysql, where contains a table called usuarios This table contains a column ID, where is Autoincrement and kind INT I need you to: Whenever I enter the first result the ID be equal…
-
2
votes1
answer1773
viewsHandle Mysql error
I have an insert script and would like to be able to display a custom message to the user for the following registration attempt message for an existing record: Duplicate entry '42-1' for key…
-
2
votes1
answer971
viewsSQL date filter on timestamp
I have the following query: SELECT name, commission, timestamp, state_name FROM magry_awoaffiliate_commission c INNER JOIN magry_users u ON (c.user_id = u.id) INNER JOIN magry_virtuemart_userinfos v…
-
2
votes1
answer3300
viewsHow to search any part of the string with mysql
Hello, I use this way to search in Mysql string%, but in a phrase "test a two three" if I use ste% it will not return the phrase, as I could search whether it contains within the sentence?…
mysqlasked 7 years, 7 months ago Lucas Caresia 2,663 -
2
votes1
answer320
viewsUPDATE without changing the date of a record
How do I change a record in my table and keep the date the record was created. In the INSERT I’m using the method now(). When I wear one UPDATE to change only one column the date is being changed,…
-
2
votes1
answer7504
viewsHow to display a photo from the database?
I can’t display the photos I’m sending to the database. I’m making a comment system with photo and managed to send them to the database (mysql). I created my database, then my table. I made the…
-
2
votes1
answer858
viewsError trying to connect via ODBC to Mysql
I’m trying to make a connection via ODBC with the Mysql Database to access data in Excel, but after performing all necessary settings the following error window is shown to me: So I set up the…
-
2
votes1
answer10272
viewsHow to fix "1452 > a Foreign key Constraint fails" error using PDO in PHP?
First I know what is the mistake of Foreign key, however I do not know why it is happening in PHP code with PDO. Insertion function: function insert_pedido($cod,$pagamento,$total){ (int)$id = $cod;…
-
2
votes2
answers289
viewsSelect in another Mysql table
Any hint as to how I can select all clients of a particular user? I’m not really understanding the logic of how I should do the query.…
-
2
votes1
answer296
viewsHow to select the name and salary of the employee of 'MG' who receives the highest salary?
I have a table with columns nome, salario and alocacao. How do I select only the worker who has the highest salary and who has the value mg in the column alocacao, unused MAX()?…
mysqlasked 7 years, 7 months ago Alisson Barcelos 41 -
2
votes1
answer1420
viewsSQL to count the characters of a field if it is less than 10
I am in great difficulty. I have the following SQL: $contardescricao = "0"; $sqlxmldescricao = "select id from imoveis where cod = '$cliente' AND (character_length(descricao)<'10')";…
-
2
votes3
answers3385
views2 COUNT within a SELECT with LEFT JOIN
I have two tables: users: id | nome | email shipments: id | id_envia | id_recebe Every time a user sends a card (which goes by email) to another user, mark this table, and every time they receive…
-
2
votes1
answer26
viewsRecord values of a related table concatenated in the main entity query
I have two tables: ordem_servico and ordem_servico_tecnicos. If more than one technician is required for an O.S., records of each technician are created in the second related table by the order…
mysqlasked 7 years, 7 months ago Rafael Silva 141 -
2
votes1
answer72
viewsSearch by word taking into account the relationship between 3 tables
I’m setting up a search system for a corporate guide and at the time of searching I’m only able to search for a specific word in a table, for example: pizza. But the ideal would be to see if there…
-
2
votes1
answer1421
viewsInner Join - return by name id in column of another table
I have two tables in DB: table category: id_categoria | nome_categoria 1 camisetas 2 estrelas table post: id_post | título | resumo | conteúdo | categoria_id 1 teste lorem ipsum 2 2 test2 lorem…
-
2
votes1
answer308
viewsmysql and php - subtract the last two records from the same column and divide by the last record from another column
I have a table carro_log that stores the update history of another table. id kilometragem combustivel dt_atualização 1 200 45 2017-05-03 2 400 35 2017-05-03 1 150 38 2017-05-02 3 220 30 2017-05-01 .…
-
2
votes2
answers42
viewsIN() order in mysql
Well I’m making the following select: select * from pedidos where id IN (1,3,4,2) Have any way mysql return me the result in the same order it is in IN? With the select I’m making mysql is putting…
mysqlasked 7 years, 6 months ago Hugo Borges 5,294 -
2
votes1
answer416
viewsI can’t find the reason for Formatexcpetion
Folks good night I have a little problem in a basic test program I’m doing someone could help me ? Error: The input string was not in an incorrect format. (Formatexception) in…