mysql

Insert 50 thousand record in MySQL

I want to insert 50 000 records into MySQL through a web service written in Java but only 20 000 records are getting inserted. I dont think there is size (number of record ) limition in my sql. is there something where i can Insert/Select 50k records in a single go (bulk) ...

Iterate over multiple MySQL tables, export 1 table from each

I have around 150 MySQL databases, I need to export 1 table from each of the databases. Is this possible, username and password are identical for each DB. ...

How to store data with dynamic number of attributes in a database

I have a number of different objects with a varying number of attributes. Until now I have saved the data in XML files which easily allow for an ever changing number of attributes. But I am trying to move it to a database. What would be your preferred way to store this data? A few strategies I have identified so far: Having one singl...

MySQLCommand BeginExecuteReader is missing an AsyncCallback parameter rendering it virtually useless

Hi, I'm hoping someone here might help me. The company I work for would prefer that I use MySQL instead of MSSQL. So I downloaded the latest driver (6.1) and am porting the DB layer. However I can not find the BeginExecuteReader function which takes a callback as parameter. Is this for a reason? Or does it work differently with MySQL...

Is there a PHP and MySQL book that deals with real world programming?

I looking for a book(s) about PHP and MySQL that deals with ratings systems, registering, login, comments, adding articles and so on. ...

How to retrieve the children categories without the children of those ones ?

Here is my statement : SELECT ( COUNT( parent.categoryName ) - ( sub_tree.depth +1 ) ) AS depth, CONCAT( REPEAT( '', ( COUNT( parent.categoryName ) - ( sub_tree.depth +1 ) ) ) , node.categoryName ) AS categoryName FROM Categories AS node, Categories AS parent, Categories AS sub_parent, ( SELECT node.categoryName, ( ...

How to track number of views in the most efficient way?

I've this blog-like system (LAMP) and I'd like to track number of views of every article. Now, is it better to update the article's views column every time the article is viewed or use some temp table, where I'd store only the article ID, and then (let's say every hour) run a query that would take the data from the temp table and update ...

Need help with pdo_mysql and data mapper pattern

I'm having issues with php-cgi.exe crashing while using php-pdo-mysql.dll. I'm using the data mapper design pattern show in Padraic Brady's Zend Off The Deep End and everything has been working correctly. I have a table which stores an ip address whitelist, and I'm able to access that properly via a mapper class using Zend_Db_Table. I...

MySQL "Sending data" horribly slow.

I have a modest-sized table, 277k records at the moment, which I am trying to do a FULLTEXT search on. The search seems to be very quick until it gets to the Sending data phase. The Table: CREATE TABLE `sqinquiries_inquiry` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ts` datetime NOT NULL, `names` longtext NOT NULL, `emails` long...

What timezone does MySQL's NOW() follow

Does MySQL's NOW() follow the system's timezone or some standard like GMT or UTC? ...

PHP display problems

I am pulling messages from mysql using PHP to be displayed on a specific page. Instead of displaying the title of the message in the designated title bar and the message in the designated body text box...there is no content displayed and its displaying the title in the url. What am I missing in my query? Or what is going on? ...

How to optimise a sql doublon checker

I would like to optimise my Doublon checker if anyone knows how it could be faster. $doublonchecker="delete bad_rows.* from eMail as good_rows inner join eMail as bad_rows on bad_rows.EMAIL = good_rows.EMAIL and bad_rows.EMAIL_ID > good_rows.EMAIL_ID"; $resultdoublon = mysql_query($doublonchecker); if (!$resultdoublon) { ...

MySQL Query: Join and Group

I have a simple contest sign-up web form. Each contestant can check a box to be eligible to win one of 20 prizes. Upon submitting a form, a row is created in the "contestants" table. For each prize they have checked, a row in the "entries" table is created. I am trying to make a "results" page that lists all prize names, and below each ...

PHP display problems revisited

I am pulling messages from mysql using PHP to be displayed on a specific page. Instead of displaying the title of the message in the designated title bar and the message in the designated body text box...there is no content displayed and its displaying the title in the url. What am I missing in my query? Or what is going on? /*--Here is...

ColdFusion or PHP Shopping script

Hello what I want to do is include a shopping cart on CF site. There are only 10 products but they want it to have their same look. Is there a way to have an include that would render a mini shopping cart inside their pages, but use outside shopping cart program. I'm not sure if there is anything like this so any suggestions would ...

How to get next/previous record in MySQL?

Say I have records with IDs 3,4,7,9 and I want to be able to go from one to another by navitagion via next/previous links. The problem is, that I don't know how to fetch record with nearest higher ID. So when I have record with ID 4, I need to be able to fetch next existing record, which would be 7. The query would probably look somethi...

Help: MySQL adapter.fill(dataset) Error

I'm connecting to a MySQL database using the MySqlClient class. When I try to fill a fill a Data List with the Data Set I get an error: #42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax Heres the code I have in VB.net to fill the data list. Dim strConn A...

Snow Leopard: connect from local wordpress to remote db

I have a Wordpress-based log, hosted on Dreamhost. I'm on Snow Leopard and I wanted to install local site, that will connect to my remote database. However, this does not work and I get this error: mysqlnd cannot connect to MySQL 4.1+ using old authentication I did not try to do this in Leopard, so I don't is it new thing in SL or was ...

Port LAMP application to EC2

Any good resource on how to port a LAMP stack to Ec2? Mainly I'm concerned about storage, the MySQL part. The existing app works agains a single store. Do I need to port all my storage to S3? Will the EC2 instances be able to share a single MySQL database? Alternatively I can partition my data and have a single database for each EC2 ima...

PHP + MySQL Web Stats

I wondering what ideas you guys had on the best method of doing some web counters backend. I will be tracking downloads via PHP, I'm looking at around 1.5 million "downloads" per day and all I will be storing would be "userid" and "downloadid". Possibly time too? What would the best way be? At the end of every day should I compile all th...