How can I insert that code in my php code I only want to use this on my bday field.
Here is my new code:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script type="text/JavaScript">
function confirmDelete(){
var agree = confirm("Are you sure you want to delete this file?");
if(agree){
// direct browser to delete.php
window.location = "./delete.php";
} else {
// do nothing and return false
return false ;
}
}
</script>
</head>
<body>
<form name="machine1" action="page3.php" method="post">
<table border="1">
<tr>
<td>Emp ID</td>
<td>Last Name</td>
<td>First Name</td>
<td>Birthday</td>
<td>Option</td>
</tr>
<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("db_machine1") or die(mysql_error());
$data_p = mysql_query("SELECT * FROM tbl_machine1") or die(mysql_error());
while($info = mysql_fetch_array( $data_p ))
{
$emp_id = $info['Emp_ID'];
$lname = $info['Last_Name'];
$fname = $info['First_Name'];
$bday = $info['Birthday'];
?>
<tr>
<td><?php echo $emp_id;?> </td>
<td><?php echo $lname;?> </td>
<td><?php echo $fname;?> </td>
<td><?php echo $bday;?> </td>
<td><a href = 'edit.php'>Edit</a> <a href='delete.php?id=$emp_id' onClick='confirmDelete();'>Delete</a></td>
</tr>
<?php
}
?>
</table>
<input type = 'button' name= 'add' value='ADD'>
</body>
</html>
Thank you