hai everyone! now add a product details is successfully in my table.and add,update,delete is also worked successfully.suppose i want to see product details added for which date and time.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Books</title>
</head>
<body>
<form method="post">
<table>
<tr>
<td>title:</td>
<td><input type="text" name="title" /></td>
</tr>
<tr>
<td>author</td>
<td><input type="text" name="author" /></td>
</tr>
<tr>
<td>publishername</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td>copyrightyear</td>
<td><input type="text" name="copy" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value="add" /></td>
</tr>
</table>
<?php
if (isset($_REQUEST['submit']))
{
include 'db.php';
$title=$_POST['title'] ;
$author= $_POST['author'] ;
$name=$_POST['name'] ;
$copy=$_POST['copy'] ;
mysql_query("INSERT INTO `book`(title,author,publishername,copyrightyear)
VALUES ('$title','$author','$name','$copy',)");
}
?>
</form>
<table border="1">
<tr>
<th>id</th>
<th>title</th>
<th>author</th>
<th>publisher name</th>
<th>copyright year</th>
<th>action</th>
</tr>
<?php
include("db.php");
$result=mysql_query("SELECT * FROM book");
while($test = mysql_fetch_array($result))
{
$id = $test['bookid'];
echo "<tr align='center'>";
echo"<td><font color='black'>" .$test['bookid']."</font></td>";
echo"<td><font color='black'>" .$test['title']."</font></td>";
echo"<td><font color='black'>". $test['author']. "</font></td>";
echo"<td><font color='black'>". $test['publishername']. "</font></td>";
echo"<td><font color='black'>". $test['copyrightyear']. "</font></td>";
echo"<td> <a href ='view.php?bookid=$id'>Edit</a>";
echo"<td> <a href ='del.php?bookid=$id'><center>Delete</center></a>";
echo "</tr>";
}
mysql_close($conn);
?>
</table>
</body>
</html>