Jump to content

Recommended Posts

i've created a posted board like this in a certain page called "board.php":

 

ID TO                            FROM                SUBJECT                    DESCRIPTION                          CHOICES    TO    MAKE

1 hasinc@contactus.com  mail@mail.com    product sold is broken  the chair that i got is broken....  ADD          EDIT    DELETE

2 hasinc@contactus.com  for_mail@mail.com    about the item      computer screen is damage....    ADD          EDIT    DELETE

3

4

 

The ADD, EDIT, DELETE is a clickable using an <a href ="add.php ">, <a href ="edit.php ">.

Now my question are as follow:

1)  how would you delete the entire row if you click the DELETE in row number 1?

2) would you use <a href ="delete.php "> to delete it or other code to use it?

3)  I want also to redirect the page to itself when the process is done, how would you do that? 

4) I want to make sure that both in the PHP DATABASE will be DELETED as the board.php will be change into something like this:

 

ID TO                            FROM                SUBJECT                    DESCRIPTION                          CHOICES    TO    MAKE

2 hasinc@contactus.com  for_mail@mail.com    about the item      computer screen is damage....    ADD          EDIT    DELETE

3

4

 

I do hope that you can help?

Link to comment
https://forums.phpfreaks.com/topic/67991-to-delete-a-message-on-the-posted-board/
Share on other sites

On your display page:

<a href=delete.php?id=$id>Delete </a>

 

delete.php would contain:

$sql = "DELETE FROM cghl WHERE id='$id'";
if (!mysql_query($sql,$connection))
{
die('Error: ' . mysql_error());
}
echo "<p>1 record deleted</p>";
[code]

[/code]

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.