I am developing online store . I want to display the list of products when the webpage load. But the problem is when i run the application it is showing following errors ...
) Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp64\www\onlineordering\db\connection.php on line 7
Here is my connection.php file.
<?php
session_start();
ob_start();
include ("define.php");
//connectivity
mysql_connect("localhost","root","") or die("<h2>Server Error:Unable to connect backend</h2>");
mysql_select_db("ecom") or die("<h2>Database not found</h2>");
//current location
$current_url = base64_encode($url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
//echo base64_decode($current_url);
$randomnumber = date ("dmYHis");
include ("functions/datafetching.php");
?>
Here is the html for Category file .
<div class="sidebar_box"><span class="bottom"></span>
<h3>Categories</h3>
<div class="content">
<ul class="sidebar_list">
<?php
$sqlCat= "select * from category where recordstatus='' order by sequence_order Asc";
$exeCat = mysql_query($sqlCat) or die ("Error in:sqlCat");
$counCat= mysql_num_rows($exeCat);
if($counCat>0)
{
$classCat=1;
while($resCat= mysql_fetch_array($exeCat))
{
$categoryname= $resCat["categoryname"];
$auto_number= $resCat["auto_number"];
?>
<form method="post" style="margin:0px;padding:0px;" action="productcategory.php" id="frmdetailcat<?php echo $classCat;?>">
<input type="hidden" name="category" value="<?php echo $categoryname?>">
<input type="hidden" name="categoryid" value="<?php echo $auto_number?>">
</form>
<?php
if($classCat==1)
{
?>
<li class="first"><a style="cursor:pointer;" onclick="subform('frmdetailcat<?php echo $classCat;?>')" ><?php echo $categoryname;?></a></li>
<?php
}else
if($classCat==$counCat)
{
?>
<li class="last"><a style="cursor:pointer;" onclick="subform('frmdetailcat<?php echo $classCat;?>')" >
<?php echo $categoryname;?></a></li>
<?php
}else
{
?>
<li><a style="cursor:pointer;" onclick="subform('frmdetailcat<?php echo $classCat;?>')" >
<?php echo $categoryname;?></a></li>
<?php
}
$classCat++;
}
}else
{
?>
<li class="first"><a href="#">No Category is avaliable</a></li>
<?php
}
?>
</ul>
</div>
</div>
Here is the screen shot when i run the application ..