Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Searching Two Mysql Tables


LifeinAsia - 5:00 pm on Mar 20, 2009 (gmt 0)


SELECT *
FROM `v_pvi`
WHERE MATCH (color,make,model,intcolor,category) AGAINST ('{$search}') AND public = 1
UNION
SELECT *
FROM `v_pvi`
WHERE MATCH (color,make,model,intcolor,category) AGAINST ('{$search}') AND public = 1

The field names must be identical in each table. Otherwise, just select the fields that do have identical names (or use aliases).


Thread source:: http://www.webmasterworld.com/php/3875305.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com