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:
怎么样?