Warning before Delete Master Record

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
shahparzsoft
User
Posts: 361

Warning before Delete Master Record

Post by shahparzsoft »

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;
}


mobhar
User
Posts: 11767

Post by mobhar »

Use "ew_ExecuteScalar" global function instead of your way to execute the query and return the first column of the first row.

Read "Some Global Functions" under "Server Events and Client Scripts" topic from PHPMaker Help menu for more information and example.


Post Reply