mysql

long running queries: observing partial results?

As part of a data analysis project, I will be issuing some long running queries on a mysql database. My future course of action is contingent on the results I obtain along the way. It would be useful for me to be able to view partial results generated by a SELECT statement that is still running. Is there a way to do this? Or am I stuck ...

Mysql Data Problem

I want to copy the whole Mysql Data including Events to newly Os installed system.is it possible to do that? Note: I have have copied the Data folder it works fine except Events. ...

Isthere any class in MySql that is like BulkCopy Class in Sql Server 2005

I want to perform same functionality that is provided in Sql Server 2005's BulkCopy Class, But I couldn't found the same in MySql. Is there any Class that is do the same kind of functionality in Bulkcopy class of Microsoft SqlServer 2005. ...

Content Restriction Ideas

Hello, I was trying to do subscription system which is only for registered user. Till registration stage, I am okie. But I don't want user to share their username and password with others because of the paid content. How can i prevent ? Check with IP, but what if they are on dynamic IP ? Using proxy ? Store cookies can change ? Can ...

Query for second maximum salary from employee table

how to find out second maximum salary from all employee in employee table ? please give me sql query. ...

PHP + MySQL iPhone MMORPG

Is it possible to make a mmorpg for the iPhone using PHP and MySQL(1,000+ players)? I was thinking of using MySQL to store all of the player information (name,username,pass,location,position). Then I would make that data accessible through php(pass a location to the php page and it returns all the player info for that area). Would PHP an...

How to optimize a nested query?

Can I somehow join tables and avoid the usage of distinct in the following MySQL query. invited_by_id shows the user id of who invited this user. SELECT user1.id, count(distinct user2.id) AS theCount, count(distinct user3.id) AS theCount2 FROM users AS user1 LEFT OUTER JOIN users AS user2 ON user2.invited_by_id=user1.id LEFT...

how to add checkbox values in mysql database?

how to add checkbox values in mysql database?Please help I always get this error when I incorporate checkbox in my form. Does the data type have to be changed in mysql. Error: 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 'check (TRANSPORT, X, Y) VAL...

Enum in Hibernate, persisting as an enum

In my MySQL database, there's the column "gender enum('male','female')" I've created my enum "com.mydomain.myapp.enums.Gender", and in my Person entity I'm defined "Gender gender". Now I'd want to keep the enum type in my MySQL database, but when I launch my application I get: Wrong column type in MyApp.Person for column Gender. F...

How do I output a multidimensional array from multiple relational MySQL tables?

I have three tables: Event, Events and Users. The Event table stores information relevant to a specific event (name, date, etc), the Users table stores user information (name, age, etc) and the Events table is the relational between the two, storing only Event_ID and User_ID. I need to list out all the events for a specific user (lets s...

MySQL: What's the difference between float and double?

Checking in the new database structure I saw that someone changed a field from float to double. Wondering why, I checked the mysql documentation, but honestly didn't understand what the difference is. Can someone explain? ...

does 'KEY' in SHOW CREATE TABLE mean a column is indexed?

I am dealing with a db I did not create. I will be issuing a number of long-running queries involving three integer columns of a large table: id (a primary key), x and y. (I won't be writing/updating records; just issuing queries.) SHOW CREATE TABLE shows that: `primary_key` int(11) NOT NULL auto_increment, `x` int(11) default NULL, `y...

how to check if a user is logged on in php. beginner

using mysql as database. I got this code from the previous answers to the same question: session_start()): if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) { echo "Welcome to the member's area, " . $_SESSION['username'] . "!"; } else { echo "Please log in first to see this page."; } Could you pl...

Should I store a field PRICE as an int or as a float int the database?

In a previous project, I noticed that the price field was being stored as an int, rather than as a float. This is done by multiplying the actual value by 100, the reason being was to avoid running into floating point problems. Is this a good practice that I should follow or is it unnecessary and only makes the data less transparent? ...

Unable to connect to mysql server on line context.commitChanges() when using Cayenne

I'm trying to run this code--> import org.apache.cayenne.ObjectContext; import org.apache.cayenne.access.DataContext; public class Main { /** * @param args */ public static void main(String[] args) { ObjectContext context = DataContext.createDataContext(); EmployeeInfo empInfo = (EmployeeInfo)context.newObject(EmployeeInfo.cl...

Rails MySQL query time confusion

Hi, I have a count calculation query which I am running thousands of times in my Rails app, once for each customer in the db. When I run the query in my MySQL client with query cache disabled the query takes last than 1ms. However, when I run my task from the Rails console with query output enabled I've noticed that after the first ...

what mysql query should i use to select a category that matches ALL my criteria?

Hi, i have the following data in my table called cat_product cat_id product_id 1 2 1 3 2 2 2 4 If given a set of values for product_id (2,3) i want to know the unique cat_id. In this case, that will be cat_id 1. how should i construct mysql query? i tried to use select distinct cat_id from cat...

Parsing XML data using php to put into mysql database.

Hello, I have been asked to parse a simple file which is stored as an XML file, the data is to be then put into a mysql database. However I have absolutely no clue what to do and after looking online all the examples given seem either too complicated for my problem or not the right solution. The XML file looks like this: <shop> <produc...

How can I save my form in a mysql database?

Hello, I am new to php, javascript and mysql. Just started 3 days ago. I have a form with some textboxes and listboxes. But now I need to save everything in a database using a INSERT query. Can anybody help me plz? Greetings Stijn ...

uploadify is tempermental? unable to list newly uploaded files in database!

hey guys i've been trying to work the uploadify script to little avail... it uploads all the files correctly to the assigned folder but no details of the upload are added via mysql. any idea of where i may be making a mistake? please help. manage.php <script type="text/javascript"> $(document).ready(function() { $("#u...