???
Maybe I didn't understand what you were trying to do. I assumed you just needed:
Code:
CREATE TABLE IF NOT EXISTS custdetail (
customer_id varchar(100), /* bad idea...should be INT and refer to customer tbl */
customer_pass1 varchar(100),
customer_count1 int,
customer_pass2 varchar(100),
customer_count2 int,
customer_pass3 varchar(100),
customer_count3 int,
customer_pass4 varchar(100),
customer_count4 int,
customer_pass5 varchar(100),
customer_count5 int
) ENGINE=InnoDB DEFAULT CHARSET=latin1;