I am in a situation where I have an established database called COUNTY_DIRECTORY, and within that database, a table called EMPLOYEE_INFO that contains all record fields. Thus far, I am able to add new records and update existing records. In the event that a profile needs to be deleted, I have used the following code to delete the specified profile. A form passes the first name and last name to the PHP script (below), which should then query the database, and finally delete the record. My problem is, the record is not getting deleted. It is hanging up on the "Information can not be deleted - contact your administrator error message'...Obviously, there is an error in my syntax, but I am not spotting it. Can anyone offer any suggestions?
<?php
$conn = @mysql_connect("localhost","michael","password")
or die("Could not connect to MySQL<br><br>Report this error to your <a href='mailto:me@luzernecounty.org'>system administratior</a> now!");
$bd = @mysql_select_db("COUNTY_DIRECTORY",$conn)
or die("Could not select database.<br><br>Report this error to your <a href='mailto:me.@luzernecounty.org'>system administratior</a> now!");
$sql = "(DELETE * from EMPLOYEE_INFO where f_name=\"$firstname\" AND l_name=\"$lastname\" )";
$result = @($sql,$conn)
or die("Could not delete information!<br><br>Report this error to your <a href='mailto:me@luzernecounty.org'>system administratior</a> now!");
if ($result) { echo ("<br><br><h2><font face='Arial' color='#4d50a3'>Profile for <font color = 'black'>$firstname $lastname</font> deleted!</font></h2><br><font face='Arial'><br>
<b>Click <a href='admin_delete.htm'>HERE</a> to delete another employee profile.</b><br><br><b>Click <a href='admin_edit_home.htm'>HERE</a> to return to administration home.</b></font>"); }
?>
Thanks in advance,
Mike
lukatchm@misericordia.edu