mysql

How to generate a tree view from this result set based on Tree Traversal Algorithm?

I have this table: CREATE TABLE `categories` ( `id` int(11) NOT NULL auto_increment, `category_id` int(11) default NULL, `root_id` int(11) default NULL, `name` varchar(100) collate utf8_unicode_ci NOT NULL, `lft` int(11) NOT NULL, `rht` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `category_id` (`category_id`), KEY `lft`...

mysql profiler "Sending data"

Is there an explanation of these statuses anywhere? http://dev.mysql.com/tech-resources/articles/using-new-query-profiler.html my specific question is in regards to this query: select count(*) from 135_5m.record_updates u, 135_5m.records r where r.record_id = u.record_id and (u.date_updated > null or null is null) and u.date_...

mysql - get details from 2 tables with 1 query.

Hi all! I have 2 mysql tables: The first table table1: | ID | NAME | | 1 | cat | | 2 | mouse | | 3 | mouse | | 4 | mouse | | 5 | mouse | | 6 | mouse | The secound table table2: | ID | NAME_NA | | 1 | cat | | 2 | mouse | | 3 | cd_rom | | 4 | dvd_rw | | 5 | house | And i want to output t...

How to see full query from SHOW PROCESSLIST

When I issue SHOW PROCESSLIST query, only first 100 characters of the running SQL query are returned in the info column. Is it possible to change Mysql config or issue a different kind of request to see complete query (the queries I'm looking at are longer than 100 characters) ...

Grant User One Point Each Day

Using PHP/mySQL, a user is granted a single integer point to their member account each day. The data I will use to determine if a point should be granted are these mysql fields: Creation Date (timestamp) and Last Login (UNIX TIME). The procedure for granting these points is determined when the user logs in. My question is, what's the mo...

Is Tornado really non-blocking?

Tornado advertises itself as "a relatively simple, non-blocking web server framework" and was designed to solve the C10k problem. However, looking at their database wrapper, which wraps MySQLdb, I came across the following piece of code: def _execute(self, cursor, query, parameters): try: return cursor.execute(query, paramet...

MYSQL REGEXP/RLIKE Advice?

I have a table called "scholarships" that has a field named "majors" which contains comma separated major names for the majors the scholarship is related too. Let's say the field could contain one (or more separated by commas) of the following: business, agribusiness, business administration, international business. If someone is searc...

MySQL (or PHP?) group results by field data

Hi guys, I have a MySQL database that looks similar to this: ID Group Name 1 1 John 2 1 Andrea 3 1 Jack 4 2 Mike 5 2 Kurt 6 3 Alice I need to sort the results in a html table that looks like this: Group Name ----------------------- 1 John ...

MySQL (or PHP?) group results by fields data

Possible Duplicate: MySQL (or PHP?) group results by field data Guys, I have a database (mysql) similar to this now: ID meta_key meta_value name 1 _group 1 John 2 _group 1 Andrea 3 _group 1 Jack 4 _group 2 Mike 5 _group 2 Ku...

Bulk insertion of values in MySQL

I am trying to take the output of a JAVA program consisting of an array of 12 for a bunch of different users and place them into a table. Is there anyway to do this in bulk, without having to do it one at a time? ...

MySQL Workbench: After renaming primary key, how to update FKs and relationships...

I am using MySQL WorkBench and came across a problem... I have existing tables in the EER diagram with various relationships setup. I'd like to rename the primary key, which is straightforward... but when I do, the relationships are not updated, and the FK references in other tables show the old name and datatype. I thought at first i...

5.0 event schedulers

Hi, Is there event scheduler in mysql 5.0, if not what is the closest way to achieve that? I need to do data transfer from 1 table from source db to destination's db table based on some condition. (in an automated manner). Also is there any way of implementing this without procedures/functions/triggers as my db has some restrictions o...

Latest version for mysql

What is the latest mysql version? is it v5.2 or v5.1? ...

Generating duplicate responses within a MySQL SELECT query

I am using the report writing functionality within an application to generate barcode product labels. The report writing system allows me to use a MySQL SELECT statement to get the information I need from our database and present it to a Jasper Reports JRXML file that formats the report. This works fine if I want to produce one barcode...

Has anyone used WebFaction hosting for large traffic websites?

Hello. I'm a point where I'm needing to move a large traffic website off of MediaTemple Grid Server (it's maxing out the resources there now and they have actually asked politely for it to be moved to something more suitable) and on to a new server that can handle things better. My first thought was setting up a VPS. The site has two m...

Create a table "alias", and change table type

Hello, I have a table called tb which is innodb - has over 1m rows. I want to do a fulltext search on the table, but I can't do that because its innodb. So, How do I create an "alias" of tb called tb2, meaning (a duplicate of the table, that updates automatically when the data of tb updates, but change the table type of tb2 to myisam ...

Javascript link, ajax, jquery, cursor is a text editor not a hand/finger and even though the code has worked it always returns the error result.

This is getting really confusing now... Updating a mysql database without leaving the page.... I have 3 bits of code. The javascript in the head tags, the action button in the body and the code to be performed on another page. Here are the three sections: <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text...

PHP Recent Forums Don't Display Certain Forums

I have set up a way for the last 5 posts to display on the home page of my site. I would like to hide 3 specific forums (I looked up the id's and they are 24, 25, 35. Just in case that means anything). I can get them to hide, however, it will not show 5 posts. So I want to be able to show the 5 most recent skipping those 3 forums, while ...

Write on InnoDB read from MyIsam

I'm working on a project that requires lots of database inserts. I also need to be able to use something like full-text-search to retrieve the data. Is is possible to use 2 tables, with the same exact data, oen MyIsam and one InnoDb to achieve this effect? Write on the InnoDb, and somehow read off of the MyIsam? ...

Grouping by date, return row even if no records found

I have a query that groups all entries from a table and groups them by the datetime column. This is all working great: SELECT SUM( `value` ) AS `sum` , DATE(`datetime`) AS `dt`` FROM `entry` WHERE entryid = 85 AND DATETIME BETWEEN '2010-01-01' AND '2010-03-01' GROUP BY `dt` ORDER BY `datetime` The problem is, I need it to return...