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
answer5211
viewsSQL Group query with more than one distinct attribute
I have an application that generates approximately 25000 records per day in BD. This will generate a large amount of id’s per day in the user’s BD. According to the user’s business rule, only failed…
-
3
votes1
answer2054
viewsonline users and time spent on the site
How can I get the amount of users online on my site (instantly), using only PHP MYSQL and JQUERY? and respectively get the time the user spent on my site
-
3
votes4
answers632
viewsHow to execute two querys in a statement?
I need to mount a Mysql query that returns the total of rows, and the total of lines with value greater than 1 in the same query. Total of lines: SELECT COUNT(*) FROM tabela Total of lines with a…
-
3
votes2
answers698
viewsHow to encode a number in PHP
I would like to know how to show a coded number to the user. I have several lines in my tables and wanted to encode (only on the user side) the ID’s. I went looking for functions for this but only…
-
3
votes1
answer2998
viewsTimestamp update automatically with current date
I wonder if it is possible, when one is made INSERT in a given table, automatically update the value of another column of the TIMESTAMP type called date with the current date and time, similar to…
-
3
votes2
answers616
views"Convert" an HTML list to Mysql with PHP
I have a large list in HTML with about 106000 lines of code. Where these lines are records and these records are subdivided into: 6 lines of information about a game (As name and year of…
-
3
votes1
answer88
viewsGet Rows from at least 3 days ago
I have a table with column datetime and I need to get the results that already have 3 days of existence, all more than 3 days, I tried to use SELECT *, DATE_FORMAT(date, '%m/%d/%Y') FROM tb WHERE…
-
3
votes1
answer84
viewsPassword - Binary Modular Crypt Format
I am currently reducing the size of a database and several are the techniques used. However, I have a question about the decision to make at a point and I would like someone to help me. In the model…
-
3
votes3
answers506
viewsUser way to include new pages on a website without programming
Just as in Wordpress you have the option to create, edit, display and edit pages I know I can use WP, but for learning I would like to do programming. I’m trying to develop a function in my panel…
-
3
votes2
answers2737
viewsHow to create two different database connections?
I need to pass data from one database (DB2) to the other (Mysql), and I’m thinking about how to do this, as in the database I have the data I do not have access to some tools, how to do the backup,…
-
3
votes2
answers479
viewsLogin to a web site by the program
I have a site programmed in PHP with login and I’m making a desktop application (Windows) and I’m trying to log in to it from these system on the web. My system in PHP works as follows: it creates a…
-
3
votes1
answer220
viewsCompetition problem in java web application
Good evening, everyone, See the following code: Controller @WebServlet("/testConcurrency") public class TestConcurrency extends HttpServlet { private static final long serialVersionUID =…
-
3
votes2
answers1627
viewsFetch data from last 7 days from current date (2014-12-11 11:06:09)
After viewing the that question, the following doubt arose that is, in the case that the date field is in the following format 2014-12-11 11:06:09, how to return only the last 7 days?…
-
3
votes4
answers2051
viewsLeave last 12 records and delete the rest in PHP/Mysql
I would like to make sure that after running the script, there can only be the last 12 records in a specific table that has the date field in international format if it can assist. <?php # Este…
-
3
votes1
answer1006
viewsHow to complement this sql query?
I have the following tables below, where schemes(columns) are described in parentheses and the primary key appears in bold: pupil(codpupil, named, dt_ticket, codcurso) course(codcurso, naming)…
-
3
votes2
answers4048
viewsReturn which of the query items are not in the table?
Is there any way to return which query items are not in a table? Let’s say I have an appointment like this: SELECT id FROM tabela WHERE id IN (1,23,45,68,91,126,345,418,509,610); This will bring me…
-
3
votes1
answer2044
viewsquery by day number of Mysql week
The week has 7 days, so I want to be able to make a query that the user according to the day of the week you choose presents the result: mysql_query("SELECT * FROM tbl_eventos WHERE WEEK(data) =…
-
3
votes4
answers1308
viewsI cannot concatenate variable in a query
I have a URL and in it a code that will vary all the time (Ex: usuario/perfil/39). I used the following code to get this URL value: $valor_id = $_SERVER['REQUEST_URI']; $cod =…
-
3
votes2
answers1046
viewsUse LIMIT together with LEFT JOIN in more than one table
I have a table anuncios, in which I wish to list the anuncios of the user together with the imagens, I’m trying with the query below, but if you have 5 imagens registered in the anuncio, in the…
-
3
votes1
answer117
viewsAutomating Inner Join using Lookupcombobox component
Sometimes I use the Tdblookupcombobox component to bring a list of a dataset lookup field, this approach streamlines some things but is very limited. For example I have a list of stores in one…
-
3
votes2
answers107
views -
3
votes1
answer4024
viewsMerge sql results into one line
I have the following database: CREATE DATABASE IF NOT EXISTS `materiais`; USE `materiais`; -- -- Table structure for table `categoria` -- CREATE TABLE `categoria` ( `id_categoria` int(11) NOT NULL,…
mysqlasked 10 years, 1 month ago Israel Zebulon 1,758 -
3
votes1
answer1400
viewsSearch registry by date in mysql
Good night, I have records in my table about phases of the moon 4089 Lua nova 1983-05-12 19:26:41 4090 Primeiro Trimestre 1983-05-19 14:18:16 4091 Lua cheia 1983-05-26 18:48:29 4092 Quarto Minguante…
-
3
votes1
answer785
viewsAngularjs with Socket.io and Mysql data
The following query in cidade.php search how many requests are open in a given city, which blocks a link. If 0, the sum of query releases the link. If it is larger than 1 blocks the link. Controller…
-
3
votes2
answers3205
viewsModeling database of a system of friends
Hello, I am developing an application where there will be an option to add friends,is very simple, it is not social network, but have to add friend. I have the user table. What tables and…
-
3
votes3
answers271
viewsHow to optimize SQL queries containing SELECT-related DELETE?
$a = mysql_query("SELECT * FROM catalog_items where page_id='84'") or die(mysql_error()); while ($row = mysql_fetch_array($a)){ $base_item = $row['item_ids']; mysql_query("DELETE FROM items_rooms…
-
3
votes1
answer903
viewsHow to go through and compare two arrays in PHP
I have two arrays that return a Mysql query. I need to compare these two results to, every time they’re different, print something on the screen. The problem is that the query coming back from the…
-
3
votes2
answers4563
viewsHow to create an executable in java + Mysql database?
I created a java desktop application that connects to a Mysql database, how can I generate this application to run on any machine along with my database? Thank you!
-
3
votes1
answer537
viewsHow to return more than one column from the same table?
With this SQL I can in my database select and group products by variations that would be in this case different attributes for the same product. Thus, when generating the product view, I have a…
-
3
votes2
answers2291
viewsStoring measure drive in Mysql table
In one of my forms it will be necessary to collect the height of the user in meters. However, this form can be in English or in Portuguese. If you are in English this height will be in feet (Feet).…
-
3
votes2
answers91
viewsRefine article ranking based on views of all articles
The idea is to ascertain the reputation of a particular article based on the views of all existing articles. An article can have a reputation of 1 to 5 stars, the same being constantly changing…
-
3
votes1
answer1106
viewsChange "Character" and "collation" settings
I have a configuration in a database as follows: SERVIDOR 1 show variables like '%version%'; innodb_version 1.1.8 protocol_version 10 slave_type_conversions version 5.5.19-log version_comment MySQL…
-
3
votes2
answers917
views -
3
votes2
answers1434
viewsObtaining the number of dependents of an official
I’m trying to do a search between 3 tables: Employee,Dependents,Function_has_dependents; I want to do the research that shows the number of dependents of each employee. I did the following: select…
-
3
votes3
answers1451
viewsView Oracle database data via Mysql
I need to know how to have the data of an Oracle database in my Mysql database, a kind of view. I do not wish to make insert, update nor delete in the Oracle bank, I need only one select of this…
-
3
votes1
answer5118
viewsDefine relationship between tables in Mysql
Today I needed to create a table that had a purpose similar to Add the Netflix queue where are saved the movies that the user wants to see (in the application would be stored the urls videos and…
-
3
votes1
answer700
viewsMysql returning null improperly - MYSQLI PHP
I’m trying to make a SELECT through PHP mysqli, but it’s returning null in all parameters of the object returned by $mysqli->query($sql). Even so it returns the rows I selected from the table,…
-
3
votes1
answer872
viewsChange Mysql column information with UPDATE
In summary through PHP below I can send the specific information already recorded in the column in the BD, only that, in addition to just "sending" the data there, I would like a function that…
-
3
votes1
answer2412
viewsSelect recursive in mysql data hierarchy
How to build a mysql function or recursive query to bring the last descending of a specific side of a binary tree? Satisfying a binary tree, each node can have only two branches, one left and one…
-
3
votes0
answers1429
viewsArtificial Intelligence using PHP and Mysql
I am looking for information on artificial intelligence using Mysql and PHP only, I did not find much information that would guide me correctly, I want to develop a small chat with virtual…
-
3
votes3
answers284
viewsCreate folder and ID simultaneously using the same id number
I need that when the user is entering a new article to be created a folder with the same number as the article ID. <?php include './includes/config.php'; setMenu("Notícias"); include…
-
3
votes3
answers50069
viewsHow to display all the results of a SELECT in PHP?
I’ve done all this code myself, but I’m having a hard time displaying all the results below each other. <?php include 'conexao.php'; ?> <html> <head> <title>GMB Mineração e…
-
3
votes1
answer375
viewsWord and Mysql formatting
Colleagues, how would you get a Word proposal to be registered within Mysql and edited? I tried using the editors wysiwyg to put and paste, but Word HTML, after saved, Mysql does not recognize.…
-
3
votes2
answers466
viewsOptimize Mysql query to remove FILESORT
I’m in the process of optimizing my web app queries. But since I don’t have much experience I can’t find a solution to remove the use of FILESORT. Does anyone have any idea what to do to end this…
-
3
votes1
answer1806
viewsPagination, Count to calculate limit and offset by MYSQL
I have a query with 7 relationships in a relatively large table, and the list of records uses the total of records as the basis, so it would be a query to calculate the total and another to display…
mysqlasked 9 years, 10 months ago Papa Charlie 8,721 -
3
votes1
answer961
viewsI need to change only half the records of a Mysql table
I made this Procedure in Mysql to change a record only half of the table but it produces an unexplained error: It seems the trouble is in the LIMIT who refuses to accept a variable. On the Sqlserver…
-
3
votes1
answer1261
viewsHow to recover Codeigniter session data directly from database?
I am trying to recover data from my table ci_sessions of CodeIgniter that are saved in a serialized way. $data = $this->db->get_where('ci_sessions', array('id' => $id))->row('data');…
-
3
votes2
answers1282
viewsAngular.js function to calculate age
Good evening, everyone. In my comic book, I store customers' date of birth. I have a list that presents: name | Cpf | age? How could I take the data stored in the bd and using Angular.js or php…
-
3
votes1
answer968
viewsHow to verify the occurrence of a string in a row and pick up x characters on the left and y on the right?
I’m having a problem with a Mysql query and I’m looking for help. Suppose I have many lines in the PROCESSES column and one of them is like this: IBAMAPROCUR: DF00025372 ADRIANA MAIA VENTURINIAPDO:…
-
3
votes2
answers66
viewsProblem to mount query
I cannot mount a query, the logic is: Select produtos with categorias different products, being the products with more points, so I will have a product of more points of the category X, another of…