Code: Select all
<?
$con=mysql_connect("localhost","root","itsSecrect");
if(!$con)
{
die('Could not connect:' . mysql_error());
}
mysql_select_db("system",$con);
$result = mysql_query("select our_feedback.username,name,type,dept,batch,feedback from user_details, our_feedback where our_feedback.username=user_details.username;");
echo"<table border ='1'>
<tr>
<th>Delete</th>
<th>Username:</th>
<th>Name</th>
<th>Type</th>
<th>Department</th>
<th>Batch</th>
<th>Feedback</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo"<tr>";
echo "<td><input type=\"checkbox\" name=\"chkid_$i\"></td>";
echo"<td>".$row['username'] . "</td>";
echo"<td>".$row['name'] . "</td>";
echo"<td>".$row['type'] . "</td>";
echo"<td>".$row['dept'] . "</td>";
echo"<td>".$row['batch'] . "</td>";
echo"<td>".$row['feedback'] . "</td>";
echo"</tr>";
}
echo"</table>";
mysql_close($con);
?> [text]This is my code which list all the feedback's from the user. I had insert a check box at the starting of each row..i want to add a button which deletes the selected feedback from the database...can any one help me in coding this ?????[/text]