Having trouble with procedural use of mysqli
Here\'s the function:
db.php
Since $link is being define in db.php probably you should
$link
require db.php;
in function.php file