Hi,
could some help me . as i want to know how to delete last record.
currenlty the code im using its based on two different pages, one for update/display record and second for deleting record.
but sum reason this code not working for me .
add.php
<?php
include("connect2.php");
$authorname = trim($_POST);
$publishyear = trim($_POST);
$booktitle = trim($_POST);
$edition = trim($_POST);
$place = trim($_POST);
$publisher = trim($_POST);
// insert into table name?
$query = "INSERT INTO book (id, authorname, publishyear, booktitle, edition, place, publisher)
VALUES ('', '$authorname', '$publishyear', '$booktitle', '$edition', '$place', '$publisher')";
$results = mysql_query($query);
if ($results)
{
echo "<br/><br/>Your book reference is :<br/>";
echo "$authorname, $publishyear, $booktitle, $edition, $place, $place, $publisher ";
// delet query
echo '<a href="deleted.php?id='.$row.'">Delete</a>';
}
mysql_close();
?>
/* for delete record */
deleted.php
<?php
include("connect2.php");
$id = $_GET;
$delete = "DELETE FROM book WHERE id = '$id' ";
mysql_query($delete);
mysql_close();
echo "Entry deleted";
?>
pls help me to correct this pice of code ... or if you know any other commend for deleting last record.
thanks