上传|数据|数据库
if ($add){
if ($picture!="none"){
$pic_data = addslashes(fread($fp=fopen($picture,"r"), filesize($picture)));
$i_str="insert into picture (picture,picture_type) values ('$pic_data','$picture_type')";
$result=mysql_query($i_str,$dbconnect);
$picture_id=mysql_insert_id();
fclose($fp);
unlink($picture);
}
else{
$picture_id=0 ;
}
$i_str="insert into index_news (news_date,news_title,news_content,news_link,picture_id,is_new,picture_side,news_show) values ";
$i_str.="('$date','$news_title','$news_content','$news_link','$picture_id','$is_new','$picture_side','$news_show') ";
if (mysql_query($i_str,$dbconnect)) echo "已添加!";
}