query($query1); $num_results1 = $result1->num_rows; echo "You deleted:
"; //outputs what record was deleted, puts the data into their respective variables based on the row that was sent via the url for ($i=1; $i <=$num_results1; $i++) { $row = $result1->fetch_assoc(); if($i==$line) { $ID = $row['ID']; echo "ID :$ID
"; $specie = $row['Specie']; echo "Specie: $specie
"; $location = $row['Location']; echo "Location: $location
"; $date = stripslashes($row['Date']); echo "Date: $date
"; $designation = $row['Designation']; echo "Designation: $designation
"; $family = $row['Family']; echo "Family: $family
"; $row = $row['Genus']; echo "Genus: $genus
"; $row = $row['Picture']; } } if(!get_magic_quotes_gpc()){ $location = addslashes($location); $ID = addslashes($ID); $specie = addslashes($specie); $date = addslashes($date); $designation = addslashes($designation); $family = addslashes($family); $genus = addslashes(genus); } //deletes from the database by what id number is in the ID variable $query = "delete from tree where ID = '".$ID."'"; $result = $db->query($query)or die('Query failed: ' . mysql_error()); if ($result) { echo "Process Successful!
"; echo "Go Back"; } else { echo "An error has occurred, Go back and try agian!"; exit; } $result1->free(); mysql_free_result($result); mysql_free_result($check2); $db->close(); ?>