Just_DO_it
New member
simply First look to this part of my php.
function ee( $var ){
return mysql_real_escape_string( $var );}
function add_sql( $field , $var ){
global $res;
if ( !empty( $_POST["$var"] ) ) {
if ( $_POST["$var"] != "-1" )
$res .= $field . "='" . ee( $_POST["$var"] ) . "' AND ";} }
$res = null;
add_sql( "nationality", "nationality" );
add_sql( "contryorgin", "contryorgin" );
add_sql( "countrystaying", "countrystaying" );
//Fields in html form
if ( !empty( $res ) ){
$Q = " WHERE " . substr( $res , 0, -4 );}
else
$Q = "";
$res="SELECT * FROM USERS $Q ";
.....etc
I have agemin and agemax in my form which means the minimum age selected and maximum if i put agemin=10 and agemax=15 will give me 10,11,12,13,14,15I want to add this condition in my $res .... WHERE age<=agemin AND age>=agemax how to add it in above
thank you in advance
function ee( $var ){
return mysql_real_escape_string( $var );}
function add_sql( $field , $var ){
global $res;
if ( !empty( $_POST["$var"] ) ) {
if ( $_POST["$var"] != "-1" )
$res .= $field . "='" . ee( $_POST["$var"] ) . "' AND ";} }
$res = null;
add_sql( "nationality", "nationality" );
add_sql( "contryorgin", "contryorgin" );
add_sql( "countrystaying", "countrystaying" );
//Fields in html form
if ( !empty( $res ) ){
$Q = " WHERE " . substr( $res , 0, -4 );}
else
$Q = "";
$res="SELECT * FROM USERS $Q ";
.....etc
I have agemin and agemax in my form which means the minimum age selected and maximum if i put agemin=10 and agemax=15 will give me 10,11,12,13,14,15I want to add this condition in my $res .... WHERE age<=agemin AND age>=agemax how to add it in above
thank you in advance