republican-creole
Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Tech and Talk » OS and Software » Webmasters and Developers » php - insert result set to different table
Search Topic:
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
Average Salaries of I.T. Professionals »
« uploading data to SQL Server 2005 timeout issues  
AuthorAll Replies


Dersgniw
Disco Crunchin
Premium,MVM
join:2001-08-10
behind you
clubs:
·Optimum Online

reply to GILXA1226
Re: php - insert result set to different table

said by GILXA1226 See Profile :

What are you using for a database engine?
MySql
--
I Smell Cures! -- Our Hope


yock
TFTC
Premium
join:2000-11-21
Fairfield, OH
MyISAM or InnoDB?


Dersgniw
Disco Crunchin
Premium,MVM
join:2001-08-10
behind you
clubs:
MyISAM


yock
TFTC
Premium
join:2000-11-21
Fairfield, OH


1 edit
MySQL supports bulk inserts by simply passing multiple data sets to the VALUES directive, like so:

You'll need to pay attention to the value of one of two PHP configuration variables too. The variable 'upload_max_size' governs how much data PHP can send directly to a host, while 'post_max_size' governs how much data PHP will allow you to send via HTTP $_POST. If you're using HTTP to send this you'll want the latter, if you're connecting directly to the MySQL server then you want the fomer.

MySQL also has limits on how much data it can receive. If your inserts are failing and PHP isn't kicking back any errors, try increasing MySQL's 'max_allowed_packet'. You can do this via command line by issuing the command:

mysql --max_allowed_packet=24M

Where "24M" is the size in megabytes of the desired value.

One final note. Though MyISAM doesn't support foreign keys, it does support unique indexes. I'm not entirely sure this will help with MyISAM (it's listed as a performance consideration for InnoDB with bulk inserts) but disabling unique checks should speed you up too if you already know that the data folows your uniqueness rules.

To disable that, login to mysql in the command line and issue the following command:

SET unique_checks=0;

I hope this helps you get started.


yock
TFTC
Premium
join:2000-11-21
Fairfield, OH
I should note too that the MySQL information in this post is for MySQL 5.1. If you're using a 4.x or 6.0 MySQL server, you may need to check on the variable names.
-
Forums » Tech and Talk » OS and Software » Webmasters and DevelopersAverage Salaries of I.T. Professionals »
« uploading data to SQL Server 2005 timeout issues  


Wednesday, 02-Dec 05:41:57 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.republican-creole
page compression OFF
Most commented news this week
· [151] Comcast Releasing Promised Usage Meter
· [69] Baltimore To Ban Lazy Cable Installs
· [56] Broadband Killed The Game Console
· [55] Latest Consumer Reports Survey Not Kind To AT&T
· [52] Rogers Unveils The ISP Dream Model
· [43] ACTA: Global Three Strikes
· [41] Rural Carriers Quickly Embracing Fiber
· [35] Charter Exits Chapter 11
· [33] AT&T Top Lobbyist Cicconi Has His Feelings Hurt
· [26] Vivendi Agrees, Comcast/NBC Deal Soon
Most people now reading
· [Newsgroups] Newzleech down? [Filesharing Software]
· Windows 7 boot manager editing questions [Microsoft Help]
· Security Software Updates - 1 Dec 2009 [Security]
· Who has SmugMug, or has used it previously? [Digital Imaging]
· [WIN7] Outlook express under Windows 7? [Microsoft Help]
· [Newsgroups] Newzleech is either down or gone for good... [Filesharing Software]
· MagicJack Error Broken Storage [MagicJack]
· Opening a file download dialog from a JavaScript function. [Webmasters and Developers]
· [RESOLVED] Possible FP Avira AntiVir Personal [Security]
· [Snow Leopard] NFS Mounts - no more Directory Utility [All Things Macintosh]