tags:

views:

97

answers:

2

I have two tables that i am inserting records into. I am using PHP to execute the sql query to perform the operation. When performing the insert operation, i insert 10,000 new records in two tables. One table completes insert process successfully on all operations while the second table completes the first insert operation but stops the insertion on the second operation when it gets to 6,384 it will stop inserting new records.

below is the table structure for the two tables:

CREATE TABLE `client_package` (
  `package_id` varchar(15) NOT NULL,
  `client_id` int(11) NOT NULL,
  `subaccount_id` int(11) NOT NULL,
  `receiver_name` varchar(50) NOT NULL,
  `receiver_address` varchar(100) NOT NULL,
  `receiver_city` varchar(20) NOT NULL,
  `receiver_state` int(3) NOT NULL,
  `receiver_phone` varchar(20) NOT NULL,
  `receiver_email` varchar(40) NOT NULL,
  `shipment_date` varchar(15) NOT NULL,
  `delivery_date` varchar(15) NOT NULL,
  `item_type` varchar(30) NOT NULL,
  `item_weight` varchar(20) NOT NULL,
  `item_quantity` varchar(15) NOT NULL,
  `package_status` int(3) NOT NULL,
  `date` varchar(12) NOT NULL,
  PRIMARY KEY  (`package_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


CREATE TABLE `package_tracking` (
  `id` int(11) NOT NULL auto_increment,
  `package_id` varchar(15) NOT NULL,
  `package_status` int(3) NOT NULL,
  `package_note` varchar(100) NOT NULL,
  `update_time` varchar(15) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;

The table giving me the problem is client_package. Also, before inserting a new record in client_package table, i first check if the generated package_id already exist and if it does i generate another one. I don't know if thats wot is actually causing the problem.

Thanks in advance.

A: 

there are some problems with importing lots of data with php. havent experienced sth like that with just 16k, but there is often something going wrong. a php programm thats called "mysqldumper" did pretty well for me, but the best way that always worked is importing directly via the mysql comandline

Flo
+1  A: 

Hey War Coder. I want to help you, but this needs some clarification. Can you provide the queries you are using to insert data into these tables? How many records are successfully being inserted? 6,384 or 16,384? This was asked in the comments, but your answer added more ambiguity imo. What errors are you getting from PHP/MySQL when you are trying this?

Thanks.

hobodave