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
answer77
viewsSendmail() BATCH localhost
Friends, I am being able to send email normally using sendmail() localhost, as follows: sendmail.ini [sendmail] smtp_server=smtp.gmail.com smtp_port=587 error_logfile=error.log…
-
3
votes1
answer2557
viewsRemove spaces via Update
I have a field called titulo, on the table noticias. Unfortunately, due to forgetting the command trim PHP, has several titles with space at the beginning and end of string. How can via SQL (Mysql)…
-
3
votes2
answers916
viewsSum of table fields with PHP and Codeigniter
I need to add some fields from a table. I have the transaction id and need to add all fields amount with id 224, all with 222.…
-
3
votes1
answer70
viewsHow to display the error coming from Mysql?
I made the code below, and works perfectly, but in case Mysql returns some error, as I will know? I have no idea, someone can help me? The message should return on alert, but I managed to create the…
-
3
votes2
answers339
viewsPHP - Problem with search return INNER JOIN with GROUP BY!
So, I have 3 table: user: | ID | NOME | SOBRENOME | | 01 | Igor | Ferreira | | 02 | João | Henrique | | 03 | Rose | Beltão | following: | ID | user1_id | user2_id | | 01 | 01 | 02 | User 1 >…
-
3
votes1
answer296
viewsHow to mount a query with optional conditions?
In the example: SELECT * FROM exemplo WHERE ID in(2, 3, 4) He brings if he has these ID at the bank. How to mount a query which places this condition only if the array in PHP have elements? PHP:…
-
3
votes1
answer440
viewsProblem generating report between dates
I have a field DATETIME with a date and time: 2015-08-06 08:50:28. I’m trying to generate a report by passing two parameters, Data_Inicial and Data_Final so that I can get all the bank dates that…
-
3
votes3
answers671
viewsHow to make SELECT in more than one bank table?
I have two tables in the database: zip code and users. Can I do a single query to get fields from both tables? Both have idCep. I want to get the address data of the cep table and the name and user…
-
3
votes1
answer178
viewsMysql html text encoding error
I’m having trouble sending sharp texts to the database as words with Ç Ã etc.. Say I send a text like this This is a posting action for you What happens that only sends minutes That and an a the…
-
3
votes2
answers1412
viewsList Tree Categories in Laravel 5.1
I’m starting with Laravel 5.1 and I’m a little lost yet. I need to list categories, subcategories and "sub-subcategories". Table: Categorias ------------------------ id | int nome | varchar…
-
3
votes4
answers1123
viewsNext record. PHP + Mysql
I am a beginner in programming and would like to know how I would make mine $id = 1, turn 2, 3 and so on. The code at the end, means that it needs to compare that value and only then occurs a $id++.…
-
3
votes1
answer79
viewsCluster difficulty and Where clause in Mysql
I need to search the database for the last 4 most recent records, the column being exr_exa_id is in agreement with the informed Ids, and exr_exa_id may not be duplicated. I tried to group in some…
-
3
votes1
answer101
viewsPDO with BIT type
I was now doing an instruction with on Duplicate and I have some fields like BIT. My class DB does the typing using PDO::PARAM_STR, PDO::PARAM_BOOL, PDO::PARAM_INT... but the use of these constants…
-
3
votes1
answer86
viewsPHP and Mysql session
I have two tables one for login and password and another where are the user data, as address, phone, etc.. After logging in would that the data displayed on the screen were not the login and yes the…
-
3
votes2
answers912
viewsHow to make sql for a field of a table that is not primary become foreign in another table?
CREATE TABLE PESSOA ( ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, CPF VARCHAR(15) NOT NULL, RG VARCHAR(10) NOT NULL, NOME VARCHAR(128) NOT NULL, DATA_NASCIMENTO DATE, PRIMARY KEY (ID) ) CREATE…
-
3
votes1
answer144
viewsHow to save String[] in Mysql
Hello, I’d like to save one String[] in Mysql, but I don’t know the type of datatype that saves String[], and what method I use to store this information.…
-
3
votes2
answers62
viewsCallback in Having
In Laravel it is possible to make a callback at the time of a consultation. For example: $q = Model::where(function($query){ $query->where(...); }); I’d like to do something similar, but with the…
-
3
votes1
answer2861
viewsExtract name and last mysql surname
Good morning Everyone, how do I extract the name and last name from a record. However the same should return the name and surname when you have only one surname. My table is like this. table =…
-
3
votes1
answer259
viewsTesting data integrity using Mysql Transactions
I’m using an Ecommerce system that uses Mysql Transactions to maintain data integrity, for example in the simultaneous purchase of multiple customers of the same product where the system needs to…
-
3
votes2
answers581
viewsRetrieve PHP combobox information
I want to insert the contents of the combobox in the database by POST, but I can’t. Here the excerpt from the combobox, which pulls the data from a table <select name="cmbtimes"> <?php…
-
3
votes1
answer1860
viewsHow to make a button in PHP, send data to my mysql table?
I put a button on my page to send the registered data to a table in mysql. <button type="button" class="btn btn-block btn-primary">CADASTRAR</button> how do I click on the button it…
-
3
votes2
answers47
viewsUpdate date summing in bank
Good morning, you guys. I have in my database DATE fields for 'start date' and 'end date', so I can search for ranges. When I imported this data some dates were empty or inconform and were not…
-
3
votes1
answer780
viewsMysql complex banking type statement how to solve
I have a VIEW table that I need to extract an extract from it, already managed with help right here from the stackoverflow progress to an extract. The problem is that now I need to filter this…
-
3
votes1
answer312
viewsProblems with accentuation and Entity Framework
This is an excerpt from my research method at the bank: public dynamic GetAll(Func<TEntity, bool> predicate, int limit, ClassContexto contexto, int idEmpresa) { dynamic data = null; try { data…
-
3
votes3
answers2295
viewsDoubt when using ON DUPLICATE KEY UPDATE
I’m trying to use ON DUPLICATE KEY UPDATE in my query and for some reason it’s not working. I withdraw the ID and no use ON DUPLICATE KEY UPDATE: values are saved in a new line in the database.…
-
3
votes2
answers570
viewsOptimize Mysql table Insert - Java
I have a loop doing millions of rows sequential Insert in a single Mysql table. I would like to know if it is possible to parallelize Insert or use some resource that increases insertion…
-
3
votes1
answer431
viewsWhy does ORDER BY RAND() slow down the query? Is there another alternative?
I had just asked questions regarding the ordering of random values through the MYSQL. From there I began to notice an uncomfortable slowness in the suggested system of friendships here of the…
-
3
votes1
answer130
viewsShould I avoid injecting "%" in a query where I use "LIKE"?
I have a page where I consult the user through the name. The query aims at the use of LIKE to capture the user name from the first letter onwards. So I consult this way SELECT * FROM usuarios WHERE…
-
3
votes1
answer742
viewsTo enter a variable, associated with a row of a table field, for a template
I’m trying to put together a list of links that point to a template, where one of the variables, with the contents of one of the table fields, should be informed dynamically in the template (being…
-
3
votes3
answers9083
viewsEnable and disable a form edit button - with PHP
I have the following situation: I have a page (ex: EDIT.PHP) that will be where the information that was previously registered by a form (User registration form) will be edited. The point is, at the…
-
3
votes1
answer9356
viewsQuery data in two tables and add one of the columns
I have two tables need to make a SELECT in both at the same time, basically it will work like this: Note that the result returns the column nome of Tabela A and sum of column media where the ids are…
-
3
votes1
answer49
viewsI can’t add a Ference
I am doing a project for the school in C#, with database and Mysql. When I try to add the extension Mysql.Data it simply is not added. I’ve installed Mysql Connector, I’ve seen hundreds of tutorials…
-
3
votes1
answer1045
viewsRemove old Mysql records automatically
I have a table that stores logs from a system. I want some method to automatically delete logs older than 60 days. It has how to do this?
-
3
votes1
answer3629
viewsHow to set charset=utf-8 in Mysql?
I’m trying to set up the charset=utf-8 in MYSQL, but not found in my.ini file. In which file configure ?
-
3
votes1
answer156
viewsBug in PDO? Table disappears after INSERT command, how to debug?
Introducing I’m creating a library with some "magic methods" on top of PDO, already I did it with Mysqli and worked beautifully. The intention is to use in a Framework I am building, finally no more…
-
3
votes1
answer359
viewsQuery sql separated by space
I have the following sql query: $sql= mysql_query("SELECT dia, GROUP_CONCAT(hora) FROM marcacoes WHERE colaborador_id = {$colaborador_id} GROUP BY dia "); The result is:…
mysqlasked 8 years, 4 months ago Smoke Rohden 793 -
3
votes1
answer1161
viewsGrab the ID of the last row inserted in the database
I am doing a project that is in the following form: First the person will upload her photo in the comic (Table: registered, field: photo) However this table has other fields, for this I created a…
-
3
votes2
answers6278
viewsHow to make a form that accepts photo upload and save to database
I created a database called Form and table with the following information contatos (id int A.I, nome varchar(30), idade int(2), foto(blob) I made that standard form: <!DOCTYPE html>…
-
3
votes1
answer1421
viewsPHP and mysql time count
Good night, I’m new here. A doubt I think is basic. I will create an "application" with PHP and mysql where I control the working hours of each collaborator with daily inputs and outputs. The…
-
3
votes1
answer91
viewsMy database is changing the last name by the registered name and no email appears
File that records: <html> <head> <meta charset="utf-8"> <title>cadastrando...</title> </head> <body> <?php $host = "localhost"; $user = "root"; $pass =…
-
3
votes2
answers485
views -
3
votes1
answer6721
viewsMYSQL calculate the chosen percentage
I’m doing a QUIZ and at a certain point I have to show the percentage of alternatives chosen by users. I have this table: ID RESPOSTA 1 a 2 a 3 b 4 b 5 c 6 a The answer I need from MYSQL would be…
-
3
votes2
answers319
viewshow to take an element from a table
Speaking of variables that can be declared within Begin, I saw that it has Declare and set only that I don’t know when to use them. I saw that you have set @x, set x, set x = x+1, set x := x+1; they…
-
3
votes1
answer110
viewsData is not saved in the database
I’m using Java, JPA, Primefaces, Wildfly and Mysql, not much to do, but it’s good to inform. I fill in all the fields, all right the check is performed. When I click save the success message is…
-
3
votes2
answers634
viewsHow to mark/deselect checkboxes per column using Jquery
Here at the company we are doing a plant management. The apartments/units that have equal end (for example, Apto 1, Apto 11, Apto 21) and so on, are below each other in the construction and for this…
-
3
votes4
answers1698
viewsRetrieve checkbox values in an array
How can I get the checkbox value in the code below? It is a presence list and this code I modified to one that I use a little different and this way I do not know how to get the values of checkboxes…
-
3
votes2
answers763
viewsTrigger in Mysql VS logic in PHP application?
I am doing inventory control system, and I would like to know the advantages and disadvantages between two forms of implementation to subtract the number in stock after a sale/output. 1) Carrying…
-
3
votes1
answer1133
viewsColumns with equal names in a single query, mysql
I’m performing a Mysql query in this style: select contents.*, users.* FROM users, contents Between the two tables there are columns with the same name, and when you pull them with PHP it results…
-
3
votes1
answer837
viewsHow to add multiple rows of two tables in Mysql
I’ve tried this code, but it only adds up to one line, if you modify the where, error or wrong sum, need to add each separate line. I need to add these two fields with several lines. km_h_tp is the…
-
3
votes1
answer1190
viewsBest practices for storing images in Amazon S3 and saving in Mysql
I’m modeling a database, but I’m in doubt how to deal with this part of saving the image on Amazon S3 and easily referencing in the database. I intend to save the image URL (hosted on Amazon S3) in…