I am loosing the value of the $areacode, when the user clicks the next button to get the next set of 5 records that time, $areacode is becoming null. only first time the value is staying in the variable $areacode, can you please tell me how can i keep the value of $areacode in it. means after i am submitting the form only for the first time the value under areacode is being used and from next time onwards $areacode is becoming null. Please help.
for example if i enter 305 as areacode under text box area code and click button search, it gets the 5 records first time properly and when i click the next hyperlink it has to get the next set of 5 matching areacode records from same table, that time it is $areacode becoming null.
if( $areacode!=null ){
$areacode_substr = " and a.areacode like '%".$areacode."%' ";
}else{
$areacode_substr = "";
}
$strSQL = "Select distinct a.id, a.login, SUBSTRING(a.comment,1, 165) as comment, a.gender, a.date_birthday, a.icon_path, j.default_icon as icon_path_default, c.".$field_name." as country
from ".USERS_TABLE." a
left join ".REFERENCE_LANG_TABLE." c on c.id_reference=a.id_country and c.table_key='".$multi_lang->TableKey(COUNTRY_SPR_TABLE)."'
where a.gender='".$gender_2."'
and STRCMP(date_format(a.date_birthday, '%Y%m%d'), date_format('".DateFromAge($age_min-1)."', '%Y%m%d')) <=0
and STRCMP(date_format(a.date_birthday, '%Y%m%d'), date_format('".DateFromAge($age_max+1)."', '%Y%m%d')) >= 0
and a.id <> '".$user[0]."' ".$areacode_substr."
and a.id != '".$user[0]."' order by a.id limit 5, 5;
$rs = $dbconn->Execute($strSQL);
thank you very much for the information.