Liquid Fire Posted August 9, 2007 Share Posted August 9, 2007 I have a table to hold some information is the 2 other table the link back to the first on by the primary key. is there a way to setup something in the database so that when i delete an entry in the first table, the anything in the other 2 tables the link to the deleted id with automatically get deleted without me having to write the code in php for that? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 9, 2007 Share Posted August 9, 2007 You will want to use a JOIN on DELETE. I'm am not very good at joins so I can't relay provide an example. JOINS allows you to run queries over multiple tables. Quote Link to comment Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 if you know how to join for the select then try that in delete like wildteen18 told you all you have to do is to determine the connection of those table and presto you can delete it all in one query 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.