View Single Post
Old 10th April 2006, 19:28
22hosting 22hosting is offline
Junior Member
Join Date: Apr 2006
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post

If you are interested I have created a set of classes in PHP to perform almost the same sort of thing. However it should be noted that he is using individual SQL Inserts whereas instead he should using the MySQL load inline function which doesn't do individual queries per data item. Alternatively instead of loading into a live database they should create a temporary table and then insert directly into that table and do a load inline from one table to another. That would almost certainly be the most efficient clean way of doing it.

My code is less messy and better commented so hopefully it will be easier to learn from that the person who wrote that script.

If you are contact me using private messages on this board.

Update : It's probably worth noting that the "count($data) >= 15" section is counting the number of items in the array $data. Therefore this shouldn't have anything to do with the number of rows it's inserting into the database. What it does do is check that the number of columns is greater than or equal to 15.

What counts I think is " $_POST["image_files_no"] " as this should return the number of times it performs the select query and draws one result from the inserted data. Therefore I suspect that if you change this to a static value i.e. the number of rows in your CSV file it should print out all the results.The image_files_no is passed from the previous page as it's a $_POST value, or it's a static value set in one of the other core php files.

Last edited by 22hosting; 22nd August 2011 at 14:05.
Reply With Quote