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


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


1 edit
reply to Dersgniw
Re: php - insert result set to different table

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, 09-Dec 17:27:49 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.
page compression OFF
Most commented news this week
· [197] Sprint Sued For Distracted Driving Death
· [97] AT&T Launching New 24 Mbps U-Verse Tier
· [81] 3G Network Test Says AT&T Is Tops
· [72] Mediacom Unveils 105 Mbps Pricing
· [66] Sprint Poised For A Turnaround?
· [63] WPA Cracker: Test WPA-PSK Networks In 20 Minutes
· [51] The Future Of Wi-Fi Is Bright
· [47] Site Leaks Yahoo, Verizon Fed Data Share Pricing
· [44] Microwaving Your Innards Is Not 'Extreme'
· [39] Verizon LTE: 5-12 Mbps Downstream
Most people now reading
· MicroSoft Discontinues Sale of Windows 7 Family Pack in US [Microsoft Help]
· Comcast refused to install 400' feet. [Comcast HSI]
· Windows 7 boot manager editing questions [Microsoft Help]
· Is sleeping similar to being dead? [General Questions]
· Man Downloads Child Porn "Accidentally," Faces 20 Years [Security]
· [ Classes] ATTN Death Knights - Post your spec for critique! [World of Warcraft]
· [Billing] $15.40 for HD Converter? [Comcast Cable TV]
· ICC strats [World of Warcraft]
· Battered Hilt Delimma [World of Warcraft]