This topic is locked

Help Events after delete

12/25/2007 6:27:49 AM
PHPRunner General questions
U
uzu1302 author

Re Bonjour,

How to delete the recordings of the table detail (action) having to delete a recording of the table Master ?

Master table = fournisseur

2 Detail table = action and produit

Key field = Id_Num
//** Check if specific record exists ****

global $conn, $numID;

$numID = $_SESSION["Id_Num"];

$strSQLExists = "select from actions where Id_Num='$numID'";

$rsExists = db_query($strSQLExists,$conn);

$data=db_fetch_array($rsExists);

if($data)

{

$strSQLInsert = "delete from action where Id_Num = $numID";

db_exec($strSQLInsert,$conn);
$strSQLExists = "select
from produit where Id_Num='$numID'";

$rsExists = db_query($strSQLExists,$conn);

$data=db_fetch_array($rsExists);

if($data)

{

$strSQLInsert = "delete from produit where Id_Num = $numID";

db_exec($strSQLInsert,$conn);
}
}

else

{

// if dont exist do something else

}
Thank you

Sergey Kornilov admin 12/26/2007

What event you plan to use for this purpose?