SQL = SELECT cc.companyid, cc.categoryid, c.name, c.token, a.city, a.state, COALESCE(c.preferredPicture, '/images/defaultCompanyPicture.jpg') as preferredPicture FROM company_category cc JOIN companies c ON c.companyid = cc.companyid JOIN addresses a ON a.companyid = cc.companyid JOIN category cat ON cat.categoryid = cc.categoryid WHERE cat.categoryid=:categoryid LIMIT 100
{"status":"success","status_code":200,"data":[{"companyid":27599924,"0":27599924,"categoryid":438,"1":438,"name":"TheBizScore.com","2":"TheBizScore.com","token":"TheBizScore.com-Stover-MO","3":"TheBizScore.com-Stover-MO","city":"Golden","4":"Golden","state":"MO","5":"MO","preferredPicture":"\/images\/profilePictures\/TheBizScore.com-Stover-MO.jpg","6":"\/images\/profilePictures\/TheBizScore.com-Stover-MO.jpg"}],"search":{"category":"438","name":"","zipcode":""}}