mysql

How to connect to Mysql through Eclipse RCP

Hello Everyone, I am try to connect to mysql database through a RCP project. I downloaded the Mysql Jconnect file. Extracted to a folder. Set the classpath variable as mentioned in the document. Still I am not able to connect to Mysql. I am getting this error SQLException: No suitable driver found for jdbc:mysql://localhost:3306/test ...

SQL Server Indexes

I was a MySQL user. Now I'm migrating to SQL Server. But I have a problem. I can not find any way for specifiying the kind of index a table has. In MySQL I could easily say to build a BTree Index or Hash Index. How can I do that here? The main problem is that I have two tables. one of them (named "posts") has a foreign key to the other ...

How does this change affect the speed of this database query?

First i was using this request: Model.object.get(name='somethink', date=somedatavariable) But then I needed to extend my query and change it to this: Model.objects.get(name__icontains="somethink", date__range(start_date,end_date)) Suddenly my database takes 5 times longer than with the original query. What's going on here, and how ...

when does mysql_pconnect() connection gets closed

It is know that connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use (mysql_close() will not close links established by mysql_pconnect()). So when does the mysql_pconnect() connection gets closed ? ...

Reading in 738627 records via flat file gives memory exhaustion error

I am trying to read in a simple flat file, it has 738,627 records in it, a sample of the file looks like this: #export_dategenre_idapplication_idis_primary #primaryKey:genre_idapplication_id #dbTypes:BIGINTINTEGERINTEGERBOOLEAN #exportMode:FULL 127667880285760002817317350 127667880285760002818261461 127667880285760002825372301 127667880...

Where should I store a foreign key?

If I have a relationship between two tables (both tables have their own primary keys) what should guide my decision as to which table should store the foreign key? I understand that the nature of the relationship probably matters (one-to-one, one-to-many, many-to-many, uni-directional, bi-directional), and probably access patterns matter...

Data source name not found and no default driver specified

The Error ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified The Story I've written a page outside of Visual Web Developer 2010 that uses a SqlDataSource object along with a FormView object that works perfect. Building upon those awesome skills I obtained I started to build a ...

2 SQL Queries from same table

I am looking to grab the first row (ordered by date descending) from a table, and then grab the rest of the rows (ordered by last_name ascending). I'm assuming I need to use a UNION statement for this, but I'm having trouble getting it to work. Thanks in advance ...

What would be the best way to store site preferences?

I'm currently working on a massive revamp of my CMS, and was wondering, what would be the best way to store site preferences... Currently my pereference setup is within database, full of structure fields (each representing it's own preference), but only id 1 is used. And... I somehow don't like this solution. Now I'm thinking of setting...

Trouble in PDO and sqlsrv land.

I set up a site on my local system using PDO and a MySQL Database. I used PDO because when the site goes on the live server I have to user SQL Server and I was hoping PDO would take care of all my query conflicts. Now that I'm up on the live server I get an error whenever the application uses the "LIMIT" function. I realize this is a My...

SQL query to get data from a large list of strings

I have a large list of strings (1500 email addresses to be more specific) and I need to look up a piece of data in a very large DB table for each of the strings (e.g. the primary key, mydataitem). How can I do it efficiently? For example, this is way too slow (amongst other problems): $stringArray = ('foo','bar','baz',..., 'for 1000s...

SELECT/UPDATE and SELECT/INSERT kills MySQL server

I run a server that is getting killed by the number of requests it is getting from one of our iPhone games for storing scores. By this I mean the server becomes unresponsive. I only really know enough MySQL/PHP to get by, so I am floundering in my attempts to fix this. I am sure its a problem that can be optimised because we have a dedi...

Php, MySql - Multiple DB connections and mysql_insert_id()

I have 2 database connections, and I want to get the last inserted ID from one of the connections. $old_database = mysql_connect('host', 'username', 'password'); mysql_select_db('database1', $old_database); $new_database = mysql_connect('host', 'username', 'password',true); mysql_select_db('database2', $new_database); $sql=mysql_query...

How to turn an image's file path into the actual image?

Hello, I've saved a user's respective picture in a folder named 'profileportraits'. So when a user uploads their picture, it is saved into that folder. Furthermore, I also save the 'portrait path', i.e. the location/name of the photo onto a MySQL database for user data. My question is: I am able to echo the Portrait Path, where the user...

Sql design question - many tables or not?

15 ECTS credits worth of database design down the bin.. I really can't come up with the best design solution for my problem. Which is this: Basically I'm making a tool that gathers a lot of information concerning the user. At the most the user would fill in 50 fields of data, ranging from simple checkboxes to text input. I'm designing t...

Special characters won't work in MySQL (UTF-8)

So, I've had some issues while trying to come over from Latin1 encoded databases, tables as well as columns, and now that everything is finally in UTF-8, I can't seem to update a row in a column. I am trying to replace an "e" with an e with acute (é). But it gives me this: ERROR 1366 (HY000): Incorrect string value: '\x82m ...' for colu...

UPDATE table problem with email address

Hi, I'm trying to update a email field in Mysql through php. i keep getting this 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 '@yahoo.com, The cell in Mysql is varchar(100). The e-mail addres is typed in from a text box. $insert_fbacc="UPDA...

Outputting multiple results from tables

The recipe db continues... categories cid | category_name 1 | desserts 2 | cakes 3 | biscuits recipes id | recipe_name 1 | black forest cake 2 | angel cake 3 | melting moments 4 | croquembouche 5 | crepes suzette ingredients iid | ingredient_code | ingredient_name | ingredient_brand 1 | abc201 | self-ra...

How to make a javascript/php chatroom more efficient in terms of load time and sql communication

Right now the setup for my javascript chat works so it's like function getNewMessage() { //code would go here to get new messages getNewMessages(); } getNewMessages(); And within the function I would use JQuery to make a get post to retrieve the messages from a php scrip which would 1. Start SQL connection 2. Validate that i...

Fantasy Draft Tool

I'm attempting to mitigate some of the fantasy football draft issues I've had the last few years by creating my own drafting tool. The major requirement, similar to the major draft tools out there (ESPN, Yahoo, CBS Sports, NFL, etc) is to allow people to log in and participate in the draft. I'd like for the draft to be started by an Admi...