If you are trying to write a single field which is above max_allowed_packet then this function will not help you (contrary to what the documentation example seems to show above).
Parameters in MySQL are still restricted by max_allowed_packet on a per-field basis so you will get an error like:
“mysqli_sql_exception: Parameter of prepared statement which is set through mysql_send_long_data() is longer than 'max_long_data_size' bytes”
The only real use case for this function seems to be if you are writing multiple long fields which when combined would go over max_allowed_packet.