Forum Moderators: coopster
Thanks in advance...
Also, keep in mind that when you extract data to an array, that puts each record in an array, there is no built-in function to put many records in an array which would be the analogue of what you're talking about.
What format is the data in currently and how big is it in bytes? The main DB I spend most of my time manipulating is only about 12MB currently, but that's still too big for me to want to do mass inserts, updates, backups over my slow network with PHP. If I need to transfer it, or something, I generally have PHP write out that SQL queries to a text file, and then feed that in via the command line client.
One thing to keep in mind as well, an array of 1,000,000 records, each with 1K of data is 1GB that you would be trying to put in memory as an array. That would tax if not crash your computer.
-sned
at the prompt
mysql -u username -p dbname < /path/to/file/forinserts.txt
though that only works if you have insert statements already
though if not you could have php read the file, create the insert statement and write it to a new file that you could use as above.
Sorry, I didn't mean to suggest that he not read that thread.
hehe, I knew that, ergo. I wasn't thinking that at all! The emphasis I was making is that the referenced links in the MySQL manual go into both options and that ultimately ionchannels could make a much better decision after contemplating the options. Personally, the command line would be my first choice if it didn't have to be scripted. Much, much faster.