i have this query .. Delete in more than one table .. but If there a field does not have content in any table, it does not delete anything
$sql = " DELETE
property,
unit,
maintenance,
report,
owner
FROM
property,
unit,
maintenance,
report,
owner
WHERE
property.id = '".$_REQUEST['property']."'
AND
unit.property = property.id
AND
unit.id = maintenance.unitid
AND
report.maintenance = maintenance.id
AND
property.id = owner.property
";
SO , what conditions can i use it in the query to skip this problem ..
You will want to look at transactions for this. This is a typical (but costly ) way to perform this kind of operation.
Alternatively, you could create a stored procedure and check that all the criteria are appropriate before executing the delete.