Strange sql query result from Mysql and from PHP mysqli_query!

Posted by qinHaiXiang on Stack Overflow See other posts from Stack Overflow or by qinHaiXiang
Published on 2011-02-02T15:23:12Z Indexed on 2011/02/02 15:26 UTC
Read the original article Hit count: 195

Filed under:
|
|

this is the query command echo from php web page:

SELECT DISTINCT FT.file_type_name AS type,FT.file_type_en AS tp,FT.file_type_id AS fti, MATCH(keywords) AGAINST ('words <2' IN BOOLEAN MODE ) AS score FROM movie AS M,file_type AS FT WHERE MATCH (keywords) AGAINST ('words <2' IN BOOLEAN MODE ) AND M.type_cn = FT.file_type_id HAVING score >=1 ORDER BY FT.file_type_order;

I am running above query in MySQL tools HeidiSQL and got only tow row records which score are 1.66666 and 2. If I remove the HAVING clause I would got three row records with one's score less than 1.

But the same query I get from PHP mysqli_query() were all the three records and the one which score less than 1 became 1.

What is the problem. Any tips will be pleasure.

Thank you very much!!

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql