如何检查以下代码?它是否正确? [英] How to Check the following code? is it correct or not?
本文介绍了如何检查以下代码?它是否正确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用基于if条件的查询。
你们中的任何人都可以检查这个并告诉正确的代码。
Hi,
I am using a query based on if condition.
Can any one of you check this and tell the correct code.
if($agemin!="")
{
$agemin='age='.$agemin;
}
if($agemax!="")
{
$agemax='and age='.$agemax;
}
if($hmin!="")
{
$hmin='height='.$hmin;
}
if($hmax!="")
{
$hmax='and height='.$hmax;
}
if($religion!="")
{
$religion='and religion='.$religion;
}
if($marital_status!="")
{
$marital_status='and marital_status='.$marital_status;
}
if($city!="")
{
$city='and city='.$city;
}
if($state!="")
{
$state='and state='.$state;
}
if($country!="")
{
$country='and country='.$country;
}
$query_for_result=mysql_query("select * from matri_user_info where gender='$gender' and status='unlock' and age between $agemin. $agemax and height between $hmin .$hmax. $marital_status.$city .$state. $country;");
谢谢
Thanks
推荐答案
agemin!= )
{
agemin!="") {
agemin = ' age ='。
agemin='age='.
agemin;
}
if(
agemin; } if(
这篇关于如何检查以下代码?它是否正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文