mysql

Integrating a Swing App With Tomcat

Hi All. I recently created a web application with GWT. Then re-used most of the code to create a Swing version of the application that accesses a local database in offline mode. I am now implementing the 'online' mode of the application and want to access the same data as my GWT application. Any ideas? Considered connecting directly to...

How do I return multiple results in a SQL subquery?

I have a query below and would like to know if it is possible to get more than 1 result. I would like to get the 4 most recent entries. Thanks! select c.email,c.text,m.alertDataID from client_users as c, monitor_alerts as a, monitor_alerts_data as m where c.id=a.userID and a.alertID=m.alertID and m.alertDataID = (SELECT alertDataID ...

Zend db adapter mysqli or PDO_MYSQL

I've seen several code samples that do this in application.ini resources.db.adapter = mysqli or resources.db.adapter = PDO_MYSQL What is the real difference between the two? Does it impact my code? when should I choose one or the other? ...

Tuning SSD MySql Performance

I'm testing SSDs for use with MySql and am unable to see any performance benefits. This makes me feel like I must be doing something wrong. Here is the setup: Xeon 5520 2.26 Ghz Quad Core 12 GB Ram 300GB 15k in RAID 1 64GB SSD in RAID 1 For the test I moved the mysql directory on the SSD. I imported a table with 3 million rows. T...

Adding fields to a complex SQL select statement

I need to return the values of two more fields from the "sys_acl_matrix" table, but I don't know how to read these AS and LEFT JOIN things. The fields I need to add are: AllowedCount AllowedPeriodLen Here is the Query $GLOBALS['MySQL']->getAllWithKey( "SELECT `ta`.`ID` AS `id`, `ta`.`Name` AS `title` FROM `sys_acl_actions` AS `ta...

Where can I find a good MySQL Database client?

I'm looking for a good MySQL Database client similar to phpMyAdmin only for the desktop. Anyone know of any that are free and as full feature as phpMyAdmin? It needs to be able to connect to remote MySQL servers. ...

inner join mysql tables

Ok here it is. i have two tables: products and product_sizes so basically my product table has id(primary key),name(product name)and size_id(foreign key from product_sizes) my product_sizes table has predetermined values: size_id name ------------------ 1 1x1 2 2x2 3 3x3 and here i have a workin...

Social web application database design: how can I improve this schema?

Background I am developing a social web app for poets and writers, allowing them to share their poetry, gather feedback, and communicate with other poets. I have very little formal training in database design, but I have been reading books, SO, and online DB design resources in an attempt to ensure performance and scalability without ov...

Mysql subquery, Update embedded into select?

Hi, I am doing a mysql injection on a site (for educational purpose i promise hehe), now, It uses mysql as its database, I cannot do: "; UPDATE..." so my question is, if i do: "OR id=(update...)".. as a subquery, that of course doesn't make any sense yet will it execute the update on the table i choose? ...

inner join, passing data from table for edit

so i have now a working inner join table. my problem is i dont know how to pass the correct values for editing in the select area. after i update. its error is Cannot add or update a child row: a foreign key constraint fails (`sadsystem/products`, CONSTRAINT `products_ibfk_3` FOREIGN KEY (`size_id`) REFERENCES `product_sizes` (`size_id`...

how to get data from three tables by a join statement in mysql

Hi Guys, In my application i have three tables, reservation, patient and sub_unit, i need to take the patient_id from reservation table and query the patient table for patient data,same time i need to take the sub_unit_id from the reservation table and query the sub_unit name from the sub_unit table... i need to put all this data in to ...

MySQL, need some performance suggestions on my match query

I need some performance improvement guidance, my query takes several seconds to run and this is causing problems on the server. This query runs on the most common page on my site. I think a radical rethink may be required. ~ EDIT ~ This query produces a list of records whose keywords match those of the program (record) being queried. My...

What's the difference between Primary Key, Unique Key and Index in MySQL?

When should I use KEY, PRIMARY KEY, UNIQUE KEY and INDEX? ...

HELP: MySQL Cluster is much slower than NDB

I have a denormalized table product with about 6 million rows (~ 2GB) mainly for lookups. Fields include price, color, unitprice, weight, ... I have BTREE indexes on color etc. Queriy conditions are dynamically generated from the Web, such as select count(*) from product where color=1 and price > 5 and price <100 and weight > 30 ... et...

multiple conditions in where clause

i am using mysql. this query is working fine: SELECT * FROM tablename where Date >'20091109' and id='11'; but below this query does not return any thing. SELECT * FROM tablename where Date between ('20091109' and '20081010') and id='11'; ...

What is MySQL "Key Efficiency"

MySQL Workbench reports a value called "Key Efficiency" in association with server health. What does this mean and what are its implications? From MySQL.com, "Key Efficiency" is: ...an indication of the number of key_read_requests that resulted in actual key_reads. Ok, so what does that mean. What does it tell me about how I'm s...

Mysql - A simple database design question

Suppose I have Tutors who take online webclasses and create learning packs. Both online webclasses and learning packscan be rated by students and finally a tutor's rating is the simple average of all the ratings on his classes and packs. This is the table architecture of our current Ratings table - CREATE TABLE IF NOT EXISTS `Ratings`...

Does MySQL use existing indexes on creating new indexes?

I have a large table with millions of records. Table `price` ------------ id product site value The table is brand new, and there are no indexes created. I then issued a request for new index creation with the following query: CREATE INDEX ix_price_site_product_value_id ON price (site, product, value, id); This took long long t...

PHP: calculating birthday from age.

Yes, this may sound strange. In the advanced profile searching form, where you can filter by age. Now you would type 18 or some other age in the field. I am storing the birthdays, in the mysql db, in the birthday field in users i have example: 1990-02-02 How can i filter by age then, in a query? Should i first make a query before, m...

dose mysql consume memory & cpu very much?

currently i have a project using solr,now i want to add some feature,so i'm thinking is need add mysql to my project solution, as i use a vps,so i must consider memory & cpu consume? so my question is dose mysql cost memory & cpu to much ? also i was thinking is solr can provide the same function,then i can reduce dependence software us...