Having trouble with procedural use of mysqli
Here\'s the function:
db.php
The way the two files db.php and function.php are glued together I think results in $link being defined as a global variable - you need to use global to access it within function:
function addItemToCatalog($var1, $var2, $var3, $var4) {
global $link;
...
}
or give the $link to the function explicitly through parameter:
function addItemToCatalog($var1, $var2, $var3, $var4, $link) {
...
}