<?php
//打开数据库
if ($new_ok){
if ($photo_size!=0){
$data = addslashes(fread(fopen($photo, "r"), filesize($photo)));
$sql="insert into new (photo,filetype) values ('$data','$photo_type')";
}
mysql_query($sql);
$err=mysql_error();
if ($err){
printf("出错");
}else{
printf("成功");
}