jurgen Posted August 13, 2003 Share Posted August 13, 2003 $query = \"SELECT * FROM intranet_opdrachten AND intranet_bedrijven WHERE omschrijving OR opdrachtgever LIKE \'%$zoeken%\'\"; This is not the right query to search in both tables (intranet_opdrachten AND intranet_bedrijven). Hopefully someone knows the solution to this problem. I can search in one table, but two seems to be difficult. Thank you! Quote Link to comment Share on other sites More sharing options...
rhysmeister Posted August 13, 2003 Share Posted August 13, 2003 \"SELECT * FROM intranet_opdrachten LEFT JOIN intranet_bedrijven ON intranet_opdrachten.id=intranet_bedrijven.id WHERE intranet_opdrachten.omschrijving OR intranet_opdrachten.opdrachtgever OR intranet_bedrijven.omschrijving OR intranet_bedrijven.opdrachtgever LIKE \'%$zoeken%\'\"; Something like this should do. I haven\'t had time to test it so can\'t be 100% sure. You need to join the two tables by a appropriate field. Do a little bit of research on table joins and you should be ok. Hope this helps. Quote Link to comment 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.