Page 1 of 1

Updated my app from PHP 5.6 to 7.2 and noticed an error

Posted: 2019-05-30 07:27
by mysh_eireannach
Hi All

Updated my app from PHP 5.6 to 7.2 on server and noticed an error

noticed an error when I try to change the owner of record.

Warning: count(): Parameter must be an array or an object that implements Countable in /home/aaa/public_html/app/admin/incFunctions.php on line 2487
OK
admin/incFunctions.php line 2487
#########################################################
/**
* @brief Inserts a record to the database
*
* @param [in] $tn table name where the record would be inserted
* @param [in] $set_array Assoc array of field names => values to be inserted
* @return boolean indicating success/failure
*/
function insert($tn, $set_array){
$set = prepare_sql_set($set_array);
if(!count($set)) return false;

return sql("INSERT INTO `{$tn}` SET {$set}", $eo);
}