darkfreaks Posted July 3, 2012 Share Posted July 3, 2012 $SQLstmt="SELECT * FROM tblModel,tblImages"; $SQLstmt=$SQLstmt."WHERE tblModel.modelNo = $modno"; $SQLstmt=$SQLstmt."AND tblmodel.modelid = tblimages.modelid"; anyone know how to fix this with the query? Quote Link to comment https://forums.phpfreaks.com/topic/265168-tblmodel-alias-not-unique/ Share on other sites More sharing options...
darkfreaks Posted July 3, 2012 Author Share Posted July 3, 2012 i noticed i had an error with the spelling of the fields before but fixed it and still having the same problem $SQLstmt="SELECT * FROM tblModel,tblImages"; $SQLstmt=$SQLstmt."WHERE tblModel.modelNo = $modno"; $SQLstmt=$SQLstmt."AND tblModel.modelID = tblImages.modelID"; Quote Link to comment https://forums.phpfreaks.com/topic/265168-tblmodel-alias-not-unique/#findComment-1358874 Share on other sites More sharing options...
xyph Posted July 3, 2012 Share Posted July 3, 2012 Don't forget spaces when you concatenate. Echo out $SQLstmt, what do you see? Quote Link to comment https://forums.phpfreaks.com/topic/265168-tblmodel-alias-not-unique/#findComment-1358880 Share on other sites More sharing options...
scootstah Posted July 3, 2012 Share Posted July 3, 2012 On a side note, PHP's concatenation operator is a little bit cleaner $SQLstmt="SELECT * FROM tblModel,tblImages"; $SQLstmt .= " WHERE tblModel.modelNo = $modno"; $SQLstmt .= " AND tblModel.modelID = tblImages.modelID"; I also added the spaces xyph was talking about. Quote Link to comment https://forums.phpfreaks.com/topic/265168-tblmodel-alias-not-unique/#findComment-1358893 Share on other sites More sharing options...
darkfreaks Posted July 3, 2012 Author Share Posted July 3, 2012 solved thanks Quote Link to comment https://forums.phpfreaks.com/topic/265168-tblmodel-alias-not-unique/#findComment-1358911 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.