Invalid query select v.rec_id, v.active, v.type,v.cart_type, v.contact_id, v.comp_name,v.affil_url,v.affil_image, v.url, v.url_catalog, v.url_map, v.email, v.keywords, v.bus_years, v.creditcards, v.password, v.img_src, v.img_srca, v.hours, v.cdate,v.contact_flag, v.udate,v.show_all,v.livehelp,v.livehelp_flag, a.type, a.address1, a.address2, a.city, a.state, a.province, a.country_code, a.zip, p.country_code as countrycode1, p.area_code, p.phone, p.type from vendor_profile as v, addresses as a, names as n, phone_numbers as p where v.rec_id= and (a.source_id = v.rec_id and a.source = 'vendor_profile' and a.type = 'vendor_business') and (n.source_id = v.rec_id and n.source = 'vendor_profile' and n.type = 'vendor_contact') and (p.source_id = v.rec_id and p.source = 'vendor_profile' and p.type = 'vendor_business') and (v.active=1 or v.active=2)