Retreiving the result from the database when the radiobutton selected by the use

Hi,

major problem was there in the testform , its working fine now. Its all because of a small mistake made by me. Am extremely sorry. ‘Small thing overlooked can be a biggest mistake’ :frowning:

But thank you very very much and sorry for made you to put you precious time here just because of my mistake.

It's nice to heard that finally your problem is solved.. :) :) :)

Its all because of You :slight_smile: but again here with one more question

One more thing, when the user selects value between 5000 to 10000, how do it extract all the result between these values? I mean query is same but do i need to modify anything in my table columns?

hi, when the user selects value between 5000 to 10000, than you have to modify your ajax script. you have to replace following code with new one.

Replace below code
[php]
#Replace below code
if($_POST[‘table’] == ‘rent_table’)
{
$rentbudget = $_POST[‘rentvalue’];
$sql = “select * from rent where location=’”.$location."’ AND area=’".$area."’ AND bedroom=’".$bedroom."’ AND budget=’".$rentbudget."’";
}
elseif($_POST[‘table’] == ‘sale_table’)
{
$salebudget = $_POST[‘salevalue’];
$sql = “select * from rent where location=’”.$location."’ AND area=’".$area."’ AND bedroom=’".$bedroom."’ AND budget=’".$salebudget."’";
}
[/php]

With following new code

[php]
#With following new code
if($POST[‘table’] == ‘rent_table’)
{
$rentbudget = explode(’
’,$_POST[‘rentvalue’]);
if(count($rentbudget) > 1){
$budget = “budget BETWEEN “.$rentbudget[0].” AND “.$rentbudget[1];
}
else{
$budget = “budget=’”.$rentbudget[0].”’”;
}
$sql = “select * from rent where location=’”.$location."’ AND area=’".$area."’ AND bedroom=’".$bedroom."’ AND ".$budget;

}
elseif($POST[‘table’] == ‘sale_table’)
{
$salebudget = explode(’
’,$_POST[‘salevalue’]);
if(count($salebudget) > 1){
$budget = “budget BETWEEN “.$salebudget[0].” AND “.$salebudget[1];
}
else{
$budget = “budget=’”.$salebudget[0].”’”;
}
$sql = “select * from rent where location=’”.$location."’ AND area=’".$area."’ AND bedroom=’".$bedroom."’ AND ".$budget;
}

[/php]

SR :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service