My answer is prepared assuming that your site is hosted in 000webhost.com.
In your code $host, $username and $db_name are not correctly defined.
With your code, even database connection is not possible, and it's strange
that you did not get any error message on the database connection failure.
For details, please refer to the following thread posted by me:
Insert data into mysql database
It will be helpful if you read more posts in the same thread.
If your site is hosted by other webhosting company, please disregard my answer above.