Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.