I have a query for a basic search function:
$querystring="SELECT * FROM rvus, cat, loc WHERE (hdng LIKE '$srchstring%' OR txt LIKE
'%$srchstring%' OR loc_strt LIKE '%$srchstring%' OR loc_dst LIKE '%$srchstring%' OR
loc_tn LIKE '%$srchstring%') AND rvus.cat_id=cat.cat_id AND cat.cat_id=$cat_id AND
loc.rvuid=rvus.revu_id ORDER BY dat desc
now the things being searched are sometimes linked to the loc table (it lists location address) and sometime they are not, as its not always relevant
so I'd like to repeat the above query, removing all references to the loc table, and then combine the two queries as a UNION - but I cant because of different numbers of columns
(I do have a column in the 'rvus' table which specifies if there is a link to the loc table - I dont know if that is useful here or not)
any advice appreciated -
I havent done a query sort with arrays but am thinking thats probably the solution?