newphpbees Posted December 20, 2011 Share Posted December 20, 2011 Hi... i had encountered problem in my select statement.. here is my query: SELECT s.EMP_NO, p.SSS, CONCAT(LNAME, ', ', FNAME, ' ', MI, '.') AS FULLNAME, s.SSSLoan, s.SSSAmor FROM hris.PERSONAL p, hris.employment em, payroll.sssloan s WHERE em.EMP_ID = p.EMP_ID AND em.EMP_NO = s.EMP_NO; the output of this query is all data in SSSLoan was displayed..I want to display only is the employee that i choose. Thank you Link to comment https://forums.phpfreaks.com/topic/253522-issue-in-select-statement/ Share on other sites More sharing options...
fenway Posted December 20, 2011 Share Posted December 20, 2011 First, you should rewrite your query using JOINS. Second, you'll want to add an expression to the WHERE clause, "em.EMP_ID = '$whatever'" (probably escaped and secured, of course). Link to comment https://forums.phpfreaks.com/topic/253522-issue-in-select-statement/#findComment-1299720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.