edit delete on admin panel

Discussion in 'PHP' started by Crazedplanet, Mar 2, 2008.

  1. #1
    Hi

    I was wondering if anyone had any advice code for sale or a good place / tutorial to look to add a section in my custom admin panel for editing and deleting records?

    thanks.
     
    Crazedplanet, Mar 2, 2008 IP
  2. nastynappy

    nastynappy Banned

    Messages:
    499
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    here is the code made by me :

    
    <?php
    /*
    Do Not Remove the Copyrights Notice to avoid doing anything Illegal !
    Script coded by BSGScripts.com
    For Crazedplanet of Digital Point Forums
    For Support , contact us at: admin@pegor.com
    */
    
    // put your db connection code here
    
    mysql_select_db($database, $conn);
    
    if(isset($_GET['action']) && $_GET['action'] == 'delete') {
    
    $del = mysql_query("DELETE FROM `table` WHERE recordid='".$_GET['id']."'"); //change the `table` to the name of table from which you wish to delete and recordid to id of your record to delete
    
    header("Location: records.php"); //change the records.php to the page where you want to go after deleting a record
    
    exit();
    
    }
    
    $listrecords = mysql_query("SELECT * FROM `table` ORDER BY linkid ASC");
    
    while($row = mysql_fetch_array($listrecords))
    
      {
    
      echo '
      <div class="options"><a href="?action=delete&id='.$row['recordid'].'">Delete</a></div>';
    
      }
    ?>
    
    PHP:
    put this code in a file, name it as records.php
    and do the required changes in the script to make it work as you want.

    Do Not Remove the Copyrights Notice to avoid doing anything Illegal !
     
    nastynappy, Mar 2, 2008 IP
  3. Crazedplanet

    Crazedplanet Guest

    Messages:
    49
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank you very much!!!!
     
    Crazedplanet, Mar 2, 2008 IP
  4. nastynappy

    nastynappy Banned

    Messages:
    499
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #4
    just thankyou??
    I was expecting something else.. (not money , ofcourse not...)
     
    nastynappy, Mar 12, 2008 IP