plz help me to resolve this problem..
Notice: Undefined variable: con in C:\xampp\htdocs\ecommerce\function\fuction.php on line 10
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\ecommerce\function\fuction.php on line 10
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\xampp\htdocs\ecommerce\function\fuction.php on line 11
<?php
$host="localhost";
$user_id="root";
$password="";
$con = mysqli_connect($host,$user_id,$password) OR die("not connected.... ");
$db = mysqli_select_db($con,'ecommerce') OR die ("not connected...");
?>
<?php
function getbrands()
{
$fetch_brand="SELECT * FROM brands";
$run=mysqli_query($con,$fetch_brand);
while($row=mysqli_fetch_array($run));
$brands_id=$row[0];
$brands_title=$row[1];
echo "<h4 align='center' style='margin:0px'>
<a href='ecommerce.php?brands=$brands_id'>$brands_title</a></h4><hr>";
}
?>