我正在使用php和wamp开发电子商务网站。当我单击产品超链接时,我正试图显示产品列表。但问题是无论我点击了什么链接,它都显示以下错误。
错误:sqlcat
这是我的connection.php代码文件..
<?php
$servername = "localhost";
$username = "root";
$password = "";
$db = "ecom1";
// Create connection
$con = mysqli_connect($servername, $username, $password,$db);
// Check connection
if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
?>
这是category.php文件的php代码。
<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 = mysqli_query($con,$sqlCat) or die ("Error in:sqlCat");
$counCat= mysqli_num_rows($exeCat);
if($counCat>0)
{
$classCat=1;
while($resCat= mysqli_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>
这是我运行应用程序时的屏幕截图。