mysql_select_db($database_CONNgram, $CONNgram);
$query_RSa2 = "SELECT * FROM a2";
$RSa2 = mysql_query($query_RSa2, $CONNgram) or die(mysql_error());
$row_RSa2 = mysql_fetch_assoc($RSa2);
$totalRows_RSa2 = mysql_num_rows($RSa2);
$maxRows_RSsearcha2 = 10;
$pageNum_RSsearcha2 = 0;
if (isset($HTTP_GET_VARS['pageNum_RSsearcha2'])) {
$pageNum_RSsearcha2 = $HTTP_GET_VARS['pageNum_RSsearcha2'];
}
$startRow_RSsearcha2 = $pageNum_RSsearcha2 * $maxRows_RSsearcha2;

$varaddress_RSsearcha2 = "%";
if (isset(Request.QueryString("%a2.address%"))) {
$varaddress_RSsearcha2 = (get_magic_quotes_gpc())? Request.QueryString("a2.address") : addslashes(Request.QueryString("a2.address"));
}
$varafm_RSsearcha2 = "%";
if (isset(Request.QueryString("a2.afm"))) {
$varafm_RSsearcha2 = (get_magic_quotes_gpc())? Request.QueryString("a2.afm") : addslashes(Request.QueryString("a2.afm"));
}
$varcity_RSsearcha2 = "%";
if (isset(Request.QueryString("a2.city"))) {
$varcity_RSsearcha2 = (get_magic_quotes_gpc())? Request.QueryString("a2.city") : addslashes(Request.QueryString("a2.city"));
}
$varcompany_RSsearcha2 = "%%";
if (isset(Request.QueryString("a2.companyn"))) {
$varcompany_RSsearcha2 = (get_magic_quotes_gpc())? Request.QueryString("a2.companyn") : addslashes(Request.QueryString("a2.companyn"));
}
$varepagelma_RSsearcha2 = "%%";
if (isset(Request.QueryString("a2.epagelma"))) {
$varepagelma_RSsearcha2 = (get_magic_quotes_gpc())? Request.QueryString("a2.epagelma") : addslashes(Request.QueryString("a2.epagelma"));
}
mysql_select_db($database_CONNgram, $CONNgram);
$query_RSsearcha2 = sprintf("SELECT a2.companyn, a2.epagelma, a2.address, a2.city, a2.afm, a2.doy, a2.thl, a2.fax, a2.email FROM a2 WHERE a2.companyn LIKE '%%%s%%' AND a2.epagelma LIKE '%s' AND a2.address LIKE '%s' AND a2.city LIKE '%s' AND a2.afm LIKE '%s' AND a2.doy LIKE 'vardoy' AND a2.thl LIKE 'varthl' AND a2.fax LIKE 'varfax' AND a2.email LIKE 'varemail'", $varcompany_RSsearcha2,$varepagelma_RSsearcha2, $varaddress_RSsearcha2, $varcity_RSsearcha2, $varafm_RSsearcha2);
$query_limit_RSsearcha2 = sprintf("%s LIMIT %d, %d", $query_RSsearcha2, $startRow_RSsearcha2, $maxRows_RSsearcha2);
$RSsearcha2 = mysql_query($query_limit_RSsearcha2, $CONNgram) or die(mysql_error());
$row_RSsearcha2 = mysql_fetch_assoc($RSsearcha2);

-------------------------------------------------------------------------------------------

I have tangled little ASP here, i want make a multiple search but i do not know how to define the default VALUE and the run time VALUE generally variables.. i works with ASP and for a little time i work with PHP and mysql. plz help..