mysql

Turn X arrays into a single array

I want to change the format of this array to match another one. One was pulled from a database, and the other was made using space delimted user input and then explode(); So here are the arrays I want to change, this is from the database (mysql_fetch_array). It grabs the single field from all rows. Array ( [name] => daniel ) Arr...

Handling deletion and renaming of relational records

I'm developing a relational system, that involves the following entities: Enquiry Quote Supplier Town Vehicle Enquiry is the main model for the system and contains foreign keys for all the other entities. Now what I'm concerned of is for example if the client goes and deletes a Town - the Enquiry record has a reference to the town i...

Can I expect a significant performance boost by moving a large key value store from MySQL to a NoSQL DB?

I'm developing a database that holds large scientific datasets. Typical usage scenario is that on the order of 5GB of new data will be written to the database every day; 5GB will also be deleted each day. The total database size will be around 50GB. The server I'm running on will not be able to store the entire dataset in memory. I've s...

MySQL COUNT problem UPDATED.

I'm trying to count how many essays have been graded so I know how many results to display on the page. But I can't seem to get the code to work properly can someone help? Thanks for the help in advance! Here is what I got so far. SELECT students.*, students_essays.*, COUNT(students_essays.id) FROM students INNER JOIN students_essa...

Any luck with Drupal 6 and Quickbooks inventory export

Looking at the Quickbooks API I only see options to sync users. I may just need to export the fields I need directly from the database? Just hoping someone had some scripts/templates to work with this already. I am not too worried about sync as long as the client could manually import web transactions at the beginning of the day ...

How do you group, bucket, and filter a result sets for a very large dataset

Sorry, the question title is somewhat vague, so here's a working example. I have a table into which each user (userid) gets a value every few days. I want to find the last of those values for each user, broken out by month, and count their number into a range. Here's an example table and representative data: CREATE TABLE `datasource` ...

Ebay style category chooser with mootools, PHP and MySQL?

Hi all, I am looking to create a similar category chooser to ebay, allowing a next level style selector, but built with mootools, php and selecting the categories from MySQL. Any help or tips on where to look or how to start more than welcome... ...

php + mysql (join?)

Maybe this way it will make more sense. MySQL "table" Code: id1 | id2 1 | 2 1 | 3 2 | 4 2 | 3 3 | 4 3 | 5 WHERE id1 = 1, this id is connected to 2 and 3: 1->2, 1->3 What I want to do is output the IDs of 2 and 3 which are NOT connected to 1, which in this particular case would be 4 and 5. 2->4 (1 is NOT connecte...

MySQL COUNT problem.

I'm trying to count all the graded essays but if an essay has been graded twice or more for some reason the code will count the same essay as many times it has been graded is there a way I can make sure that the essay is counted only once? Thanks for the help in advance! Here is the code. SELECT COUNT(students_essays.id) FROM student...

Sorting string characters in MySQL

I have a column (varchar(255)) in a mysql table, lets call it "word". How to write a select query that returns me the values in this column sorted by characters in the string? For example, if one of the records had the word "earth" it should return me "aehrt" and so on, for all the rows. Is there any way to do it in a single query? ...

MySQL view to CSV file using Java, Spring, and Hibernate

I've been asked to output a CSV file from a view in MySQL. The app I currently am writing uses Spring and Hibernate to create the database, but the view is just handed to me. Hibernate doesn't know anything about this view, but I'd want to do something like this: public List<Object> getCsvView() { return (List<Object>) getHibernate...

C# MySQL Connector

Should I build my own wrapper class for MySQL or should I use download one of the installable MySQL addins for Visual Studio to help? My App is pretty simple, but I'm also new to C#. ...

datetime implementation in php mysql

how can i get only the time from the datetime variable? i am storing the datetime in the database. If i only need to fetch the time, how can I do it? I have to run a single query in which I want to fetch the date and time from the datetime column. i need to use the date and time in different fields. ...

Ruby on Rails / MySQL: how do I do a search on an array using OR?

Both privacy and users are arrays. I've taken out some logic to show the important stuff. named_scope :non_employees_and_beloning_to_users, lambda { |args| privacy = args[0] users = args[1] { :conditions => ["(visibility = ? && user_id = ?)", privacy, users] } } but basically, the above generates the below, and when t...

Problem with sql query

Hello, I'm using MySQL and I'm trying to construct a query to do the following: I have: Table1 [ID,...] Table2 [ID, tID, start_date, end_date,...] What I want from my query is: Select all entires from Table2 Where Table1.ID=Table2.tID **where at least one** end_date<today. The way I have it working right now is that if Table 2...

Help me rewrite this query

I have this query: SELECT diamond_id, carat, clarity, color, cut, CASE clarity WHEN "FL" THEN 0 WHEN "IF" THEN 1 WHEN "VVS1" THEN 2 WHEN "VVS2" THEN 3 WHEN "VS1" THEN 4 WHEN "VS2" THEN 5 WHEN "SI1" THEN 6 WHEN "SI2" THEN 7 WHEN "I1" THEN 8 WHEN "I2" THEN...

Where to begin with a java project.

I've tried searching for similar questions here and I don't think I've found anything that matches what I'm looking for. I would like to know where to start in developing a (most likely) database-driven Java application that could keep track of customers, invoices, and quotes for my dad's auto shop. There will be a couple computers in th...

MySQL query problem.

So far I can list all the students essays and graded student essays and was wondering how would I be able to display all ungraded essays? What else do I have to add to my MySQL code? Thanks for the help in advance! Here is the code I have so far. SELECT students.*, students_essays.* FROM students INNER JOIN students_essays ON stud...

Hi , I want to make the page when the visitor refresh update the field .. the code is here

Hi , I have a problem with mysql query .. I have a table in the data .. name is (Info_website) , the field is (NumVisitor) .. the problem when the visitor refresh the page I want the filed (NumVisitor + 1) but infact it +2 .. this is the code .. $sql2 = "UPDATE `Info_website` SET `NumVisitor` = `NumVisitor`+1 WHERE `Id`=1 LIMIT 1"; ...

MySQL COUNT problem.

Is there a way I can count how many ungraded essays there are to be displayed? IF so What else do I have to add or take away from my MySQL code? Thanks for the help in advance! Here is my MySQL code. SELECT students.*, students_essays.* FROM students INNER JOIN students_essays ON students.student_id = students_essays.student_id L...