Re: count with match probelm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Lynch wrote:

...

$how_many = mysql_result(mysql_query("SELECT COUNT(*), MATCH(ad_sub,
ad_text) AGAINST('$words') AS score from ".$tcname."ads WHERE
MATCH(ad_sub,
ad_text) AGAINST('$words') FROM ".$tcname."ads where is_confirmed=1"),0);


Hmmmm.  Actually, I *can* tell you that you shouldn't have FROM in there
twice.  You've messed up your query something awful with that.


also he just wants the count with this statement so:

'MATCH(ad_sub,ad_text) AGAINST('$words') AS score'

shouldn't be part of this query, instead:

"SELECT COUNT(*) FROM ".$tcname."ads where is_confirmed=1 WHERE MATCH(ad_sub,ad_text) AGAINST('$words')"

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux