mysql

PHP mySQL - select unique value that not being used from dirrefent table

Updates : Please see below i have table: data +-----------------------+--------------+-----------+ | State | d_country | d_postcode| +-----------------------+--------------+-----------+ | State1 | Country1 | 1111 | | State2 | Country2 | 2222 | | State3 ...

MySQL SELECT results from 1 table, but exclude results depending on another table?

Hey, What SQL query would I have to use if I want to get the results from a table 'messages' but exclude rows that have the value in 'messages_view' where field messages.message=messages_view.id AND messages.deleted=1 AND messages_view.user=$somephpvariable In more laymen terms, I have a messages table with each message denoted by an '...

how to import ISO 2709 to mysql?

i have a 'ISO 2709' file. i have to convert it to any format that can be imported in mysql table. what format is possible? XML ?? and how?? (i am searching in google about this,but asking you may get a better solution) thanks. ...

getting userbase vote average and individual user's vote in the same query?

Here goes: T1 [id] [desc] 1 lovely 2 ugly 3 slender T2 [id] [userid] [vote] 1 1 3 1 2 5 1 3 2 2 1 1 2 2 4 2 3 4 In one query (if possible) I'd like to return: T1.id, T1.desc, AVG(T2.vote), T2.vote (for user viewing the page) I can get the first 3 i...

Rails Rake Error with XAMPP mysql database

I have installed XAAMP on my win7 machine and I have the apache server/mysql running on there. I set up rails to work with XAmpp as described here: XAMPP and RAILS This tutorial advises you to add this code to the XAMPP httpd.connf : Listen 3000 LoadModule rewrite_module modules/mod_rewrite.so ################################# # RUBY S...

MySQL select help

Hi I have a table that looks like this id : productid : featureid (1, 1, 16) (2, 1, 21) (3, 1, 25) (4, 2, 16) (5, 2, 21) (6, 2, 27) where featureid is a foreign key to another table. I need to select products that have both featureids of 16 and 25, in the example this would be productid 1 but not productid 2. Can someone...

Stored procedure using cursor in mySql.

I wrote a stored procedure using cursor in mysql but that procedure is taking 10 second to fetch the result while that result set have only 450 records so, I want to know that why that proedure is taking that much time to fetch tha record. procedure as below: DELIMITER // DROP PROCEDURE IF EXISTS curdemo123// CREATE PROCEDURE curdemo1...

Connection drop problem with Hibernate-mysql-c3p0

hi all, This is an issue which I have seen all across the web. I will bring it up again as till now I don't have a fix for the same. I am using hibernate 3. mysql 5 and latest c3p0 jar. I am getting a broken pipe exception. Following is my hibernate.cfg file. com.mysql.jdbc.Driver ...

COCOA Objective-c : How can connect to mysql database?

I am creating application for MAC using cocoa framework, I would like to know how and what are the ways i can connect to MySql database using cocoa framework. ...

MYSQL select query where multiple conditions in same column must exist

I'm putting together a dating site and I'm having a mysql query issue. This works: SELECT * FROM `user` , `desired_partner` , `user_personality` WHERE dob BETWEEN '1957-05-18' AND '1988-05-18' AND country_id = '190' AND user.gender_id = '1' AND user.user_id = desired_partner.user_id AND desired_partner.gender_id = '2' A...

Is it possible to use Sphinx search with dynamic conditions?

In my web app I need to perform 3 types of searching on items table with the following conditions: items.is_public = 1 (use title field for indexing) - a lot of results can be retrieved(cardinality is much higher than in other cases) items.category_id = {X} (use title + private_notes fields for indexing) - usually less than 100 results...

Storing cached data - what amount of formatting?

Hi everyone, I am in the middle of a web app and we're just about to start with a cache-layer that features memcache and disk-based cache. We just questioned ourself - what level/amount of formatting should we use on the stored cache data? Let say that we have a database table called articles. Articles table have a number of columns ...

Pros and cons with automated/manual cache

Hi everyone, I am thinking a lot about whether to head for a complete automated cache or manual cache. Our automatic approach would be a solution that digs through the database, queries and format each potential and future data request and saves it to an appropriate cache storage(memcache or disk based). Data would then not be invalida...

Saving tree-structures in Databases

Hello everyone. I use Hibernate/Spring and a MySQL Database for my data management. Currently I display a tree-structure in a JTable. A tree can have several branches, in turn a branch can have several branches (up to nine levels) again, or having leaves. Lately I have performanceproblemes, as soon as I want to create new branches on d...

How to save to two tables using one SQLAlchemy model

I have an SQLAlchemy ORM class, linked to MySQL, which works great at saving the data I need down to the underlying table. However, I would like to also save the identical data to a second archive table. Here's some psudocode to try and explain what I mean my_data = Data() #An ORM Class my_data.name = "foo" #This saves just to the 'da...

Using cassandra instead of memcache?

Hi! I keep reeding those articles from different sources that big sites are switching from memcache to cassandra. Coming from a mySQL background, I'll get a slight headache trying to see the pros/cons when compared to each other. Can you help me out to learn more about this? ...

can we build ASP.NET MVC based on MYSQL database?

Hi Guys, Can we build ASP.NET MVC based on MYSQL database? if yes, is there any article availabe? thanks ...

can we build ADO.NET entity framework based on MYSQL database?

Hi guys, I am using MUSQL Database extensivly in my projects, can we build ADO.NET entity framework based on MYSQL database? if yes, any articles?? thanks ...

How to differenciate the data when doing a UNION on 2 SELECTS ?

If I have the following two tables : Employes Bob Gina John Customers Sandra Pete Mom I will do a UNION for having : Everyone Bob Gina John Sandra Pete Mom The question is : In my result, how can I creat a dumn column of differenciate the data from my tables ? Everyone Bob (Emp) Gina (Emp) John (Emp Sandra (Cus) Pete (Cu...

What is wrong with this SQL statement

The error is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RA---SIN', 'DEC--SIN', 0.0,-90.0)' at line 1 INSERT INTO files_table (filename, folder, survey, telescope, author, observer, equinox, ctype1, ctype2, crval1, crval2) VALUES('H001_abcde_lut...