It seems to work, although I don't have a table that matches the data yet. I'll try to throw one together.
Note: You did have 1 typo -
while ($row = mysql_fetch_array($result)
I post that just for anyone reading this/potentially using your example, I'm not nitpicking your assistance. Thanks again.
while ($row = mysql_fetch_array($result))
Use your own table and your own columns!
Since you didn't give us any real example to work with, I had to make one up.
I showed the basics: How to sort text and date and number columns. Just clone those sort functions and rename them/adapt them to match your data.
// Column name => column value
$filter = array(
'city' => $city,
'text' => $text,
'group' => $group,
$filter_sql = 'WHERE ';
foreach ($filter as $key=>$value)
$filter[$key] = "MATCH ($key) AGAINST ('$value') ";
$filter_sql .= implode($filter, ' AND ');
$query = "SELECT * FROM Posts
ORDER by Date DESC LIMIT $limit_posts OFFSET $first_post";
Rajdeep's naser *MIGHT* work, *IF* you have created a full text index for your table.
But it's way OVERKILL for the simple kind of query filtering needed here.
It's really a bad answer, overall.
Rajdeep: This answer is not a very good advertisement for your "Web Development Services". It would certainly make me suspect that you wouldn't do the best development job for me.