I have migrated from mysql functions in PHP to mysqli functions (from PHP 5.4 to PHP 5.5). The problem is that most of the conversion demands that I use global because I had function like this:
function insert_custom_data($params, $table_name){
global $conn;
// do the mysql insert
$id = mysqli_insert_id($conn);
// ... rest of the code
}
Is there a possibility of having it working without using global or parameter in the function? maybe with a class?