Jump to content

How to Sort the Results from Php Mysql


Afser

Recommended Posts

Hello,

 

how to Sort the Results in PHP mysql ..

<?php
include_once("include/conn.php");
include_once("include/functions.php");


if(isset($_POST['search']))
{
$search_query="";

$val = "0";

if($_POST['property_type']!='select')// && $_POST['country']!='select' && !empty($_POST['ind_type']))
{

	if(!empty($search_query))
		$search_query .= " AND property_type='$property_type'";
	else 
		$search_query = " property_type='$property_type'";// AND country='$country' AND industry_type like '%$ind_type'";
}

if($_POST['region']!='select')
{
	if(!empty($search_query))
		$search_query .= " AND region='$region'";
	else 
		$search_query = " region='$region'";
}

	if($_POST['pax']!='select')

{
	if(!empty($search_query))
		$search_query .= " AND pax >='".$_POST['pax']."'";// AND beds='$keyword' ;

	else 
		$search_query = " pax >='".$_POST['pax']."'";

}


if($_POST['swimming_pool']!='select')
{
	if(!empty($search_query))
		$search_query .= " AND swimming_pool='$swimming_pool'";
	else 
		$search_query = " swimming_pool='$swimming_pool'";
}

	if($_POST['keyword']!='')
{
	if(!empty($search_query))
		$search_query .= " AND Beds='$keyword'";
	else 
		$search_query = " Beds='$keyword'";
}

if($search_query!="")
$search_query = " Where ".$search_query;


}

?>

and how i can get relvant results of pax there.. not the extact value.. and how i can get the result in Ascending order of PAX.

 

 

Link to comment
https://forums.phpfreaks.com/topic/51452-how-to-sort-the-results-from-php-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.