ary1080 Posted November 29, 2010 Share Posted November 29, 2010 I have a site that users can login to and add friends to their list, delete friends from their list, etc. My problem is that if a user deletes a friend from their list, it will delete the friend from the base table. If I setup a VIEW, will deleting a row from a view also delete it from the base table? Quote Link to comment https://forums.phpfreaks.com/topic/220129-views-question/ Share on other sites More sharing options...
intellix Posted November 29, 2010 Share Posted November 29, 2010 I had a similar conversation with a friend... I was asking if I could use Views in a similar way and he told me that this is not what views are for. It sounds like you have some foreign key dependencies where when you delete from one place it will delete from another automatically for you... did you create your table using MySQL Workbench at all? Quote Link to comment https://forums.phpfreaks.com/topic/220129-views-question/#findComment-1140922 Share on other sites More sharing options...
ary1080 Posted November 29, 2010 Author Share Posted November 29, 2010 I used the mysql console to setup all of the tables. Quote Link to comment https://forums.phpfreaks.com/topic/220129-views-question/#findComment-1141009 Share on other sites More sharing options...
requinix Posted November 29, 2010 Share Posted November 29, 2010 A VIEW is something that lets you view data in tables in a different way than is actually set up in the table. You can do JOINs and expressions and whatever and SELECT from it as if it was a table. Depending, you might be able to INSERT or UPDATE it. If the SQL you used has an "ON DELETE CASCADE" then that's the problem. Otherwise I'd start looking at your code to see if it's causing the problem. Quote Link to comment https://forums.phpfreaks.com/topic/220129-views-question/#findComment-1141015 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.