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:
Code: Select all
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();
}
}