+1  A: 

The first error comes from your call_user_func_array statement: you need quotes around the mysqli_stmt_bind_result, otherwise PHP assumes it's a constant.

And there's no free() function in mysqli_stmt, use $stmt->free_result() instead.

Tatu Ulmanen