This topic is locked
[SOLVED]

 Need help with an issue on some code

3/28/2019 6:40:42 PM
PHPRunner General questions
ladykathleen author

//** Check if specific record exists ****

global $conn;

$strSQLExists = "select from Forms-App where UserID='" . $values["UserID"] . "'";

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

$data=db_fetch_array($rsExists);

if($data)

{
// if record exists continue on

}

else

{

// if dont exist do Stop and give message

$message = "UserID" . $values["UserID"] . " Missing FORMS - Please add them now ";

return true;

}
This worked before I changed the part in the select statement from
$strSQLExists = "select
from Forms where UserID='" . $values["UserID"] . "'";
to
$strSQLExists = "select * from Forms-App where UserID='" . $values["UserID"] . "'";
Now it bypasses it without the message even if the does not exist.

ladykathleen author 3/28/2019

I figured it out..
It was my true and false was off.