首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

小弟我做一个xls文件下传 本地正常 爱服务器不正常 ,多了5条数据

2013-02-15 
我做一个xls文件上传本地正常 爱服务器不正常 ,多了5条数据print_r($array)//exit()foreach($array as $

我做一个xls文件上传 本地正常 爱服务器不正常 ,多了5条数据
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()')
[解决办法]
CSDN 提供了代码美化功能,请使用

你这乱七八糟的一大堆,没人有心情看
[解决办法]
$array有6条元素,不要怀疑其它可能。不信 var_dump(count($array));
[解决办法]
$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 
);

热点排行