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