好的,所以我用我的 PHP 脚本构建了这个查询:
SELECT *
FROM sale_properties
WHERE advert_heading LIKE '%harnham%'
OR main_advert LIKE '%harnham%'
OR advert2 LIKE '%harnham%'
OR advert3 LIKE '%harnham%'
OR street LIKE '%harnham%'
OR district LIKE '%harnham%'
OR town LIKE '%harnham%'
OR county LIKE '%harnham%'
OR area LIKE '%harnham%'
OR postcode LIKE '%harnham%'
AND numeric_price >= 150000.00
AND numeric_price <= 152000.00
现在,这确实给了我一些结果,但是,我想基本上在数据库中搜索关键字并在价格范围内。上面的查询确实给了我关键字,但似乎忽略了大部分价格范围。
这看起来正确吗?还是可以建造得更好?