I want to show a warning message before deleting a master record, that CANNOT DELETE MASTER RECORD WHILE CHILD RECORDS EXIST.
I put the below statements under page_datarendering function, but no action happened. Please help.
global $conn;
$sql = "select count(products_id) v_count
from sulata_products where products_categoryid='". $rsold['categories_id']."'";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
{ $finalcount = $row['v_count'];}
If ($finalcount >= 1) {
echo "Child Records Exit";
return false;
}