SELECT * FROM tblprofile as A,tblphotos as B WHERE A.intUserID=B.intUserID AND A.isActive='YES' AND (A.strFirstName like 'Jillian' AND A.strLastName like 'O'Brien') : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Brien')' at line 1