Jump to content
Killersites Forums

jgill916

New Members
  • Posts

    1
  • Joined

  • Last visited

jgill916's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Ben, first of all great thanks to you for this script and it is going to help me a lot at work. I was actually setting it up with our own database and added all the row names and so on. Editing, adding, viewing results works just fine. But the only problem I dealing with is when I try to delete any existing record. I believe that whenever I change DELETE FROM content WHERE id_number=$id_number in delete.php file ($id_number is the row in my custom database so had to change it), it shows different error each time. Right now if I have it like that then I get an error saying But then If I change mysql_query to DELETE FROM content WHERE id_number='$id_number' then it will not delete that file but will redirect me to listed location. Would you please help me figure out the problem? Here is the whole delete.php here if you need to go through it: <?php /* DELETE.PHP Deletes a specific entry from the 'content' table */ // connect to the database include('connect-db.php'); // check if the 'id' variable is set in URL, and check that it is valid if (isset($_GET['id_number']) && is_numeric($_GET['id_number'])) { // get id value $id = $_GET['id_number']; // delete the entry $result = mysql_query("DELETE FROM content WHERE id_number='$id_number'") or die(mysql_error()); // redirect back to the view page header("Location: view-paginated.php?page=4"); } else // if id isn't set, or isn't valid, redirect back to view page { header("Location: view-paginated.php?page=4"); } ?> Thank you in advance Mr. Falk.
×
×
  • Create New...