Forum Moderators: open
SELECT MATCH (prod_name,
long_prod_desc)
AGAINST('$this->search')
FROM $table_name
WHERE DISTINCT MATCH(
prod_name,
long_prod_desc)
AGAINST('$this->search') as
score,
prod_name,
long_prod_desc
ORDER BY score DESC LIMIT $this->from, $max_results Thanks,
Steven.
here [dev.mysql.com] you've got MATCH syntax.
So to select that you would need:
SELECT DISTINCT prod_name, long_prod_desc
FROM $table_name
WHERE MATCH(
prod_name,
long_prod_desc)
AGAINST('$this->search')
ORDER BY prod_name, long_prod_desc DESC LIMIT $this->from, $max_results
However I am not sure what you want to achieve here, the name "score" makes me unsure.
Regards
Michal
PS. Maybe tell us what you want to achieve, not how does your query look like.
For that we'll need part of your table layout, some data in it and what you want to achieve with explaination.