我希望此查询从我的数据库请求扩展和部门。我可以只使用其中一个,但不能同时使用。
代码:
$this_user_ext =$_REQUEST['extension']; <----This line here I need 'department' in it as well.
// sending query
mysql_query("DELETE FROM users WHERE extension = '$this_user_ext'")
or die(mysql_error());
if($_POST['action'])
{
include('maildelete.php');
$extension=$_POST['extension'];
header("Location: index.php");
}
答案 0 :(得分:0)
所以基本上,你需要类似的东西:
$this_user_ext = $_REQUEST['extension'];
$this_user_dep = $_REQUEST['department'];
//please escape and/or validate the request values
$query = "DELETE FROM users WHERE "
. "extension = '$this_user_ext' "
. "AND department = '$this_user_dep';";
mysql_query($query) or die(mysql_error());
//please don't use mysql_query(), because it is deprecated