Well the way I would do it, if you could get the names listed into an array that'd be great.
Pseudo-code example:
///// Put the tables into an array somehow.
$DBArray=array(0=>'TableA', 1=>'TableB', 2=>'TableC');
///// Start the loop
for ($n=0;$n<count($DBArray);$n++) {
$query ='DELETE FROM '.$DBArray[$n].' ';
$query.='WHERE fieldname=criteria';
if (!mysql_query($query)) {
///// do error message or whatever if it doesn't work.
echo 'Table data in '.$DBArray[$n].' NOT deleted.';
}else{
///// do nothing or some kind of status message.
echo 'Table data in '.$DBArray[$n].' deleted.';
}
}
That's how I would approach your problem.
Or is that too simplified ?