Jump to content

Delete associated rows in other tables


Guest

Recommended Posts

Hi there,

 

I have created a deletion link on my CMS so that when a user wants to delete a profile, he can just click on that link to delete it. I have 2 issues though:

 

- First, I included an onclick feature that should warn the user that he is about to delete a profile and ask him if he is sure about that. Here is the code:

<a href="delete_actor.php?actor=<?php echo urlencode($sel_actor['id']) . "&currentpage=" . $currentpage ; ?>" onclick="return confirm('Are you sure you want to DELETE this actor's page?');">Delete <?php echo $sel_actor['first_name']?>'s page</a>

 

The thing is, when a user clicks on that link, it deletes the page but there is no warning about deleting it.

 

- Second issue, there is a table linked to the profile table, listing all the credits for each actor. How could I delete the credits for the actor I want to delete, so that the table containing all the credits does not contain information that are not relevant?

 

Thanks in advance for your help.

 

Cheers,

 

Krys

Link to comment
https://forums.phpfreaks.com/topic/179040-delete-associated-rows-in-other-tables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.