隔离墙是好的,如果是的话,就存在失踪人员。 但是,如果正确读到这一点,那么你会做些什么呢? 现在是:
if($catID) {
实际上,只有卡迪卡(或,从_GET美元中支离破碎)是非零的(不是假的)。 我的猜测是,如果要检查一下信息数据库是从KQ返回的类别?
$catID = intval($_GET["catID"]);
checkcat($catID);
function checkcat($check_category) {
$checkSQL = mysql_query("SELECT * FROM category WHERE category_type= 2 ");
while($checkROW = mysql_fetch_array($checkSQL)) {
if ( $check_category != $checkROW["categoryID"] ) {
echo "err msg";
} else {
echo "not an error message";
}
}
}
了解你所期待的是什么,为什么像现在这样?
$catID = ($_GET["catID");
if ( !is_numeric($catID) ) {
echo "Not a numeric category!"
} else {
$checkSQLQuery = "SELECT * FROM category WHERE categoryID = {$catID} AND category_type= 2 "
$resultSQL = mysql_query($checkSQLQuery, $db);
/* NOTE!: Guessing on what your database resouce
pointer is - it isn t included in the origin snippet.
Although, the last opened should be used by default if
this is left out. */
if ( mysql_num_rows($resultSQL) < 1 ) {
echo "Error message, category ID not found"
} else {
echo "Found it!"
}
}