INSERT上的文件名消失(文件上传)

时间:2013-04-24 06:18:15

标签: php mysql

foreach ($_FILES['files']['tmp_name'] as $key=>$value){
    $ads_table=ads_table;
    $path_to_save_db='ads/'.$_FILES['files']['name'][$key];
    $id="60";
    mysql_query("INSERT INTO $ads_table (ad_url)  VALUES ('$path_to_save_db')") or (mysql_error());
}

这很好用! 但是当我添加另一列“id”

foreach ($_FILES['files']['tmp_name'] as $key=>$value){
    $ads_table=ads_table;
    $path_to_save_db='ads/'.$_FILES['files']['name'][$key];
    $id="60";
    mysql_query("INSERT INTO $ads_table (id,ad_url)  VALUES ('$id','$path_to_save_db')") or (mysql_error());
}

它插入id=>60 ad_url=>ads/:no file name: 怎么样?

0 个答案:

没有答案