Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
I have tried to get some PHP code to check if a record exists before posting to a table, followed another example, but it posts even when it is not supposed to; when $rcount <> NULL. The code:
function CheckRowSave(){
$sqlCheckRow = "SELECT COUNT(*) FROM hrectemp
JOIN hrecord ON hrecord_classid = '#RECORD_ID#' AND hrecord_date = hrectemp_date;" ;
nuRunQuery($sqlCheckRow);
$rcount = mysqli_num_rows($sqlCheckRow);
nuDebug($rcount); //This will place the SQL query into the zzzsys_debug table for viewing.
if (empty($rcount)) {
savehrec();
}
}
What am I doing wrong please?
Last edited by mahmud on Tue Feb 03, 2015 12:41 pm, edited 1 time in total.