print_r($array);
// exit();
foreach($array as $v){

// print_r($v);
// exit;
 $sql="INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, 
    `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, 
    `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`,
     `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`,
      `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES (
     '{$_SESSION['user_no']}',  '$v[18]', '$v[3]', '$v[3]', '', '', '$v[6]', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 
       '', '', '$v[product_key]', '', '', '', '',  '', '$v[audit_date]', '', '$v[publish_date]', '', 'now()')";  echo $sql."<br>";
 exit;
这是我的程序  下面是输出结果  不知道其它的5条数据是怎么出来的
Array ( [0] => Array ( [1] => 1 [2] => [3] => 2667749211QWEhan [4] => [5] => [6] => 8H539 [7] => Gold Photo Frame [8] => [9] => ::8H539::8H539 [10] => 10000 [11] => |Furniture & Furnishings|Home Decor|Photo & Picture Frames [12] => 39601.574282407 [13] => 已上架 [14] => [15] => [16] => [17] => 0 [18] => 0 [19] => 1 [20] => [21] => [22] => [23] => [24] => ) [upload_time] => 2013-01-25 21:16:14 [up_file_name] => trade2cn_product_data_bak.xls [up_file_url] => /opt/lampp/htdocs/dev_utoo/userdata/partners/trade2cn/datafeed/uploaded/20130125/20130125211614_productinfo.xls [up_file_size] => 16896 [extension] => xls ) INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', '0', '2667749211QWEhan', '2667749211QWEhan', '', '', '8H539', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'now()')
INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', '4', '3', '3', '', '', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '2', '', '', '', '', '', '2', '', '2', '', 'now()')
INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', 'a', 'd', 'd', '', '', 'c', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 't', '', '', '', '', '', 't', '', 't', '', 'now()')
INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', 'd', 't', 't', '', '', 'a', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '/', '', '', '', '', '', '/', '', '/', '', 'now()')
INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'now()')
INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'x', '', '', '', '', '', 'x', '', 'x', '', 'now()')

解决方案 »

  1.   

    Array ( [0] => Array ( [1] => 1 [2] => [3] => 2667749211QWEhan [4] => [5] => [6] => 8H539 [7] => Gold Photo Frame [8] => [9] => ::8H539::8H539 [10] => 10000 [11] => |Furniture & Furnishings|Home Decor|Photo & Picture Frames [12] => 39601.574282407 [13] => 已上架 [14] => [15] => [16] => [17] => 0 [18] => 0 [19] => 1 [20] => [21] => [22] => [23] => [24] => ) [upload_time] => 2013-01-25 21:23:38 [up_file_name] => trade2cn_product_data_bak.xls [up_file_url] => /opt/lampp/htdocs/dev_utoo/userdata/partners/trade2cn/datafeed/uploaded/20130125/20130125212337_productinfo.xls [up_file_size] => 16896 [extension] => xls ) INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', '0', '2667749211QWEhan', '2667749211QWEhan', '', '', '8H539', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'now()')
    在  echo $sql."<br>";
     exit;就是正常的  不加exit;就不正常  原因出在哪呢
      

  2.   

    CSDN 提供了代码美化功能,请使用你这乱七八糟的一大堆,没人有心情看
      

  3.   


    Array ( [0] => Array ( [1] => 1 [2] => [3] => 2667749211QWEhan [4] => [5] => [6] => 8H539 [7] => Gold Photo Frame [8] => [9] => ::8H539::8H539 [10] => 10000 [11] => |Furniture & Furnishings|Home Decor|Photo & Picture Frames [12] => 39601.574282407 [13] => 已上架 [14] => [15] => [16] => [17] => 0 [18] => 0 [19] => 1 [20] => [21] => [22] => [23] => [24] => ) [upload_time] => 2013-01-25 21:23:38 [up_file_name] => trade2cn_product_data_bak.xls [up_file_url] => /opt/lampp/htdocs/dev_utoo/userdata/partners/trade2cn/datafeed/uploaded/20130125/20130125212337_productinfo.xls [up_file_size] => 16896 [extension] => xls ) INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', '0', '2667749211QWEhan', '2667749211QWEhan', '', '', '8H539', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'now()')
      

  4.   


    Array ( [0] => Array ( [1] => 1 [2] => [3] => 2667749211QWEhan [4] => [5] => [6] => 8H539 [7] => Gold Photo Frame [8] => [9] => ::8H539::8H539 [10] => 10000 [11] => |Furniture & Furnishings|Home Decor|Photo & Picture Frames [12] => 39601.574282407 [13] => 已上架 [14] => [15] => [16] => [17] => 0 [18] => 0 [19] => 1 [20] => [21] => [22] => [23] => [24] => ) [upload_time] => 2013-01-25 21:37:28 [up_file_name] => trade2cn_product_data_bak.xls [up_file_url] => /opt/lampp/htdocs/dev_utoo/userdata/partners/trade2cn/datafeed/uploaded/20130125/20130125213728_productinfo.xls [up_file_size] => 16896 [extension] => xls ) INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', '0', '2667749211QWEhan', '2667749211QWEhan', '', '', '8H539', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'now()')
    INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', '8', '3', '3', '', '', '1', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '2', '', '', '', '', '', '2', '', '2', '', 'now()')
    INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', 'a', 'd', 'd', '', '', 'c', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 't', '', '', '', '', '', 't', '', 't', '', 'now()')
    INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', 'd', 't', 't', '', '', 'a', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '/', '', '', '', '', '', '/', '', '/', '', 'now()')
    INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'now()')
    INSERT INTO `inventory_prod_def` ( `user_no`,`supplier_id`, `prod_id`, `prod_sku`, `type`, `standard_prod_id`, `title`, `title_native`, `description`, `description_native`, `prod_features`, `prod_features_native`, `dimension_measure_unit`, `prod_length`, `prod_width`, `prod_height`, `prod_package_length`, `prod_package_width`, `prod_package_height`, `weight_measure_unit`, `prod_package_weight`, `prod_shipping_weight`, `packing_factor`, `shipping_factor`, `shipping_cost`, `brand`, `number_of_items`, `manufacturer`, `prod_mpn`, `msrp`, `msrp_currency`, `prod_external_url`, `meta_keyword`, `meta_description`, `prod_status`, `has_variants`, `variant_id`, `approved_by`, `approved_date`, `created_by`, `created_date`, `update_by`, `update_date`) VALUES ( '432', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'x', '', '', '', '', '', 'x', '', 'x', '', 'now()')
      

  5.   

    已经用了。应该只有一条数据啊。本地测试都只插入一条  放的ftp就多插了5条
      

  6.   

    $array有6条元素,不要怀疑其它可能。不信 var_dump(count($array));
      

  7.   

    $array总共有5个元素,分别为:
    Array ( 
    [0] => Array ( [1] => 1 [2] => [3] => 2667749211QWEhan [4] => [5] => [6] => 8H539 [7] => Gold Photo Frame [8] => [9] => ::8H539::8H539 [10] => 10000 [11] => |Furniture & Furnishings|Home Decor|Photo & Picture Frames [12] => 39601.574282407 [13] => 已上架 [14] => [15] => [16] => [17] => 0 [18] => 0 [19] => 1 [20] => [21] =>         [22] => [23] => [24] => ) 
    [upload_time] => 
         2013-01-25 21:37:28 [up_file_name] => trade2cn_product_data_bak.xls [up_file_url] => /opt/lampp/htdocs/dev_utoo/userdata/partners/trade2cn/datafeed/uploaded/20130125/20130125213728_productinfo.xls 
    [up_file_size] =>  
      16896 
    [extension] => 
       xls 
    );