这是我的代码:
$international_categories = $_GET['international_categories'];
$query = "SELECT *
FROM
tourDB
WHERE
categories LIKE '$international_categories'";
$result = mysql_query( $query ) or die ( mysql_error() );
if ( $result !== false && mysql_num_rows($result) > 0 ) {
while ( $ilist = mysql_num_rows( $result ) > 0) {
$tour_id = stripslashes( $ilist[ 'tour_id' ] );
$tour_type = stripslashes( $ilist[ 'tour_type' ] );
$tour_name = stripslashes( $ilist[ 'tour_name' ] );
$day = stripslashes( $ilist[ 'day' ] );
$nights = stripslashes( $ilist[ 'nights' ] );
$tour_price = stripslashes( $ilist[ 'tour_price' ] );
$overview = stripslashes( $ilist[ 'overview' ] );
$itinerary = stripslashes( $ilist[ 'itinerary' ] );
$terms_conditons = stripslashes( $ilist[ 'terms_conditons' ] );
$inclusions = stripslashes( $ilist[ 'inclusions' ] );
$exclusions = stripslashes( $ilist[ 'exclusions' ] );
$twin_triple_sharing = stripslashes( $ilist[ 'twin_triple_sharing' ] );
$single_occcupancy = stripslashes( $ilist[ 'single_occcupancy' ] );
$child_with_no_bed = stripslashes( $ilist[ 'child_with_no_bed' ] );
$inf_below = stripslashes( $ilist[ 'inf_below' ] );
$pricing_details = stripslashes( $ilist[ 'pricing_details' ] );
$url = stripslashes( $ilist[ 'url' ] );
$international_list_cat .= <<<INTERNATIONAL_LIST_CAT
<!-- html output -->
INTERNATIONAL_LIST_CAT;
}
else {
$international_list_cat = <<<INTERNATIONAL_LIST_CAT
<!-- html output -->
INTERNATIONAL_LIST_CAT;
}
我试图缩短“类别”列的值为“$international_categories”的行
value's of$international_categories = $_GET['international_categories']
也有空格,虽然我到了$_GET['international_categories']
这里,但 MySQL 没有整理出$_GET['international_categories']
在其“categories”列中具有 value 的行。