I am conventing old mysql to mysqli and run into a problem, which is that my mysqli_connect will not work in any my functions. after looking on the internet I found that it was a scope problems so i passed the mysqli_connect variable on to the function. which did not work. here are my two error
Notice: Undefined variable: con in C:\xampp\htdocs\bear_mysqli\functions\cart.php on line 44
Warning: Missing argument 1 for products(), called in C:\xampp\htdocs\bear_mysqli\shop.php on line 30 and defined in C:\xampp\htdocs\bear_mysqli\functions\cart.php on line 40
$con = mysqli_connect("localhost","root","","bear") or die ($connect_error);
function products($con)
{
$get = mysqli_query($con,'SELECT * FROM items WHERE quantity > 0 ORDER BY id DESC ');
}