Hello,
I try to insert a button and add this code to "Server" tab but it is not working.
//********** Check if specific record exists ************
global $conn;
$strSQLExists = "SELECT * FROM `classes` WHERE `StageID` IS NULL AND `Students` IS NULL AND `SchoolID` = ".$_SESSION["UserID"].";";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);
if($data)
{
// if record exists do
echo "<script>alert('All Fields must be completed.');</script>";
}
else
{
// if dont exist do
header("Location: schools_edit.php?editid1=" . $_SESSION["UserID"]);
exit();
}
How to execute this code from a button?
Thanks,
Abbas