Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/220129-views-question/
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/220129-views-question/#findComment-1140922
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/220129-views-question/#findComment-1141015
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.