hi every one. i have two tables
table_1 ( std_id primary key, std_name, tchr_id foreign key ); table_2 ( tchr_id primary key, tchr_name );
as from the above tables i have the foreign key constraint. it mean if i want to delte teacher id it must be firstly deleted from the table 1 and so on so forth.
but now my question is m trying to delete with the following query in
$query = mysql_query("DELETE FROM table_2 WHERE tchr_id='".$id."'") or die(mysql_error());
but this could't delted and an error is shown as it could be for the foreign key constraint. but i want to show the error in such a way that name of the tables couldn't be shown...