I have the following code in my before display event: My problem is the page hangs with the loading box even though it works as I intended. I have to refresh to reload. Deleting causes the same issue. Hangs but after refresh the record has gone. I think I am missing a return but I've tried various ways to no effect. Can some one please tell me what's wrong?
Thanks in anticipation. PHP newbie
//** Check if specific record exists ****
global $conn;
$strSQLExists = "select * from induction where User_Name='".$_SESSION["UserID"]."'";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);
if($data)
{// if record exists do something
---- hide the add / edit / delete buttons --------------------------------
$xt->assign("add_link",false);
$xt->assign("inlineadd_link",false);
}
else
{
echo "<center><b><font color=red>No records yet</font></b></center>";
// if dont exist do something else
}
// Place event code here.
// Use "Add Action" button to add code snippets.