count with match probelm

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

 



Hi,
I am running this kind of a statement:

$q=mysql_query("select cno,date_and_time,MATCH(ad_sub, ad_text)
AGAINST('$words') AS score from ".$tcname."ads WHERE MATCH(ad_sub, ad_text)
AGAINST('$words') AND is_confirmed=1 LIMIT $limit1, $limit2");

which is running fine...my problem is I am using a class for pagination
which requires the total number of records that will be returned to break
the query into pages....and which will give me the values of $limit1 and ,
$limit2 which i will use in the above statement...but running a count() is
not working, it gives me an error, what other options do i have other than
running the same query twice and using mysql_num_rows? (which i think would
be quite intensive/wasteful as i am querying @ 100 rows each time)

This is my count() query, maybe theres a problem here?

$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);

Thanks in advance,
Ryan



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 3/21/2005

-- 
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