For example:
First Name: (value of first name in record)
Last Name: (value of last name in record)
And then there will be a button on the bottom that says, Confirm delete. And then when the user clicks that button, the record will get deleted.
I just don't know how to use the radio buttons that contain the ID of each record to do this..
Code: Select all
echo "<tr><td><input type='radio' name='idselect' value=".$row["ID"]." /></td>Code: Select all
@$id_select=$_POST['idselect'];Code: Select all
@$id_select=$_POST['idselect'];
If ($record_action=='Delete')
echo "<h1> Delete Record </h1>";
$db=mysql_connect("localhost","root") or die(mysql_error());
mysql_select_db("project6",$db) or die (mysql_error());
$SQL="SELECT * FROM 'contacts' WHERE ID='$id_select'";
$result=mysql_query($SQL) or die(mysql_error());
$num_results=mysql_num_rows($result);
$row=mysql_fetch_array($result);
echo "".$row["ID"]."".$row["First_Name"]."".$row["Last_Name"]."".$row["Address"]"";
mysql_close($db)