<?
mysql_connect("localhost","","");
mysql_select_db("");
mysql_query("SET NAMES UTF8");
$year = $_POST["year"];
$term = $_POST["term"];
$strSQL = "SELECT FROM report where year ='$year' AND term = '$term' order by year";
$objQuery = mysql_query($strSQL);
}
?>
โค้ดส่วนติดต่อเดต้าเบสไม่ครบมั้งครับ mysql_connect("localhost","","") or die(mysql_error());
mysql_select_db("") or die(mysql_error());
และลองใส่ or die("[$strSQL]".mysql_error());
Code (PHP)
<?
mysql_connect("localhost","","") or die(mysql_error());
mysql_select_db("") or die(mysql_error());
mysql_query("SET NAMES UTF8");
$year = $_POST["year"];
$term = $_POST["term"];
$strSQL = "SELECT FROM report where year ='$year' AND term = '$term' order by year";
$objQuery = mysql_query($strSQL) or die("[$strSQL]".mysql_error());
}
?>