From an email from the OP I will post their additional info here for all to see.
Code:
the table is:
cb_urls (
id int(11) NOT NULL auto_increment,
poll_id int(11) NOT NULL default '0',
link_count int(11) default '0',
popularityrank int(7) default '0',
destination varchar(12) NOT NULL default '',
title varchar(70) default NULL,
description text(400),
category varchar(100) default NULL,
PRIMARY KEY (id),
KEY category (category)
)";
there are some rows with the same 'destination', 'title', 'description', but with different
id, poll_id, popularityrank etc...
i would like to ensure that no row with the same 'destination' should repeat in the search results.
and order the results by popularity rank.
the query is:
PHP Code:
$sth = mysql_query("SELECT * FROM cb_urls WHERE category='".addSlashes(strtolower($keywords))."' OR title LIKE '%".addSlashes(strtolower($keywords))."%' or description LIKE '%".addSlashes(strtolower($keywords))."%' GROUP BY popularityrank LIMIT $mdf_startbound, $perpage");