if ($title=="" or $detail=="" or $type=="0") {
echo "<H2> กรุณากรอกข้อมูลให้ครบ </H2>";
exit ();
}
include "connect.php";
$sql="INSERT INTO tb_new
VALUES(null,'$title','$detail','$type','','$date_today','$time_today')";
mysql_db_query("$dbname",$sql);
$ext = strtolower(end(explode('.', $photo_name)));
if ($ext == "jpg" or $ext == "jpeg" or $ext == "png" or $ext=="gif") {
$sql="select max(id_new) from tb_new";
$result=mysql_db_query($dbname,$sql);
$r=mysql_fetch_array($result);
$id_max=$r[0];