checkbox in a table in php

DFxPirate

New Member
I have table which will be populated (from reading from mysql table). I should provide the user an option to select a row and delete it from the database. Till now I have populated the table (by reading from the mysql). But I dont know how to add a checkbox to each row. This is what I have till now.\[code\]<html><body><?php $username="root"; $password="root"; $database="test"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM table1"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close();?><?php $i=0; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; while ($i < $num) { $f1=mysql_result($result,$i,"sno"); $f2=mysql_result($result,$i,"lastname"); $f3=mysql_result($result,$i,"firstname");?><font face="Arial, Helvetica, sans-serif"><?php echo "<tr><td> $f1 </td><td>$f2 </td><td> $f3 </td></tr>"; ?></font><?php $i++; } echo "</table>";?></body></html>\[/code\]Can anyone please help me how to add a checkbox to each row.Thanks
 
Back
Top