我希望我能集中探讨《乌拉圭回合宪章》中的各种变量。 目前,它使用一种基于表格的搜索方法。
它使用此方法。
<?php
include( db.php ); // include your code to connect to DB.
$tbl_name="mobile"; //your table name
$whereClauses = array();
if (! empty($_POST[ Model ])) $whereClauses[] ="model= ".mysql_real_escape_string($_POST[ Model ])." ";
if (! empty($_POST[ Mins ])) $whereClauses[] ="minutes= ".mysql_real_escape_string($_POST[ Mins ])." ";
if (! empty($_POST[ Texts ])) $whereClauses[] ="texts= ".mysql_real_escape_string($_POST[ Texts ])." ";
if (! empty($_POST[ Freegifts ])) $whereClauses[] ="free_gift= ".mysql_real_escape_string($_POST[ Freegifts ])." ";
if (! empty($_POST[ Network ])) $whereClauses[] ="network_name= ".mysql_real_escape_string($_POST[ Network ])." ";
if (! empty($_POST[ Merchant ])) $whereClauses[] ="merchant_category= ".mysql_real_escape_string($_POST[ Merchant ])." ";
$where = ;
if (count($whereClauses) > 0) { $where = WHERE .implode( AND ,$whereClauses); }
$sql = mysql_query("SELECT * FROM $tbl_name".$where);
?>
然而,我已经把这一点添入我的网页:
<?php
$model = $_GET[ model ]; //gets model from URL
$mins = $_GET[ mins ]; //gets mins from URL
$texts = $_GET[ texts ]; //gets mins from URL
$freegift = $_GET[ free-gift ]; //gets mins from URL
$network = $_GET[ network ]; //gets mins from URL
$plan = $_GET[ plan ]; //gets mins from URL
?>
不需要所有变量。 希望得到任何帮助。
提前感谢: