function.php
function consql()
{
$con=mysqli_connect("host","BDusername","DBPassWord","DB") or die( mysqli_error($con));
return $con;
}
index.php
require_once"inc/function.php";
$con = consql();
explanation :
why no error appears in your localhost? is it a PHP.ini problem ?
maybe errors are hidden on your localhost or mysqli_query runs with no problem there.
but there is a problem on your host, such as connection problem, missing or broken database table or etc...
base on your code, when no error occurs, mysqli_error() wont run and you dont get error