DELETE function.. (doesnt function)? i have a table named category with two field that are (caID and CaName)
viewCategory.php
<h1 align="center"><div align="center">
<h3>View Category</h3>
</h1>
<h1 align="center">
<?
include("configure.php");
?>
</h1>
<div align="center">
<table width="778" id="rounded-corner" border="1">
<tr>
<th width="35" class="rounded-company" scope="col"><div align="center"><strong>No</strong></div></th>
<th width="246" class="rounded-company" scope="col"><div align="center"><strong>Category Name</strong></div></th>
<th width="40" class="rounded-company" scope="col"><div align="center"><strong>Edit</strong></div></th>
<th width="57" class="rounded-company" scope="col"><div align="center"><strong>Delete</strong></div></th>
</tr>
<?
$sql="SELECT * FROM category ";
$kuari=mysql_query($sql);
$add=1;
while($hasil=mysql_fetch_array($kuari)){
?>
<tr>
<td><div align="left"><?echo $hasil['caID'];?></div></td>
<td><div align="left"><?echo $hasil['caName'];?></div></td>
<td><div align="center"><a href="<? echo"EditItem.php?No=$hasil[No]";?>">Edit</a></div></td>
<td><div align="center"><a href="<? echo"DeleteCategory1.php?No=$hasil[caID]";?>" onClick="return confirm('Are you sure you want to Delete Category?')">Delete</a></div></td>
</tr>
<? }?>
</table>
</div>
<h1 align="center"><div align="center">
<h3>View Problem</h3>
</h1>
<h1 align="center">
<?
include("configure.php");
?>
</h1>
<div align="center">
<table width="778" id="rounded-corner" border="1">
<tr>
<th width="35" class="rounded-company" scope="col"><div align="center"><strong>No</strong></div></th>
<th width="246" class="rounded-company" scope="col"><div align="center"><strong>Problem Name</strong></div></th>
<th width="40" class="rounded-company" scope="col"><div align="center"><strong>Edit</strong></div></th>
<th width="57" class="rounded-company" scope="col"><div align="center"><strong>Delete</strong></div></th>
</tr>
<?
$sql="SELECT * FROM problem ";
$kuari=mysql_query($sql);
$add=1;
while($hasil=mysql_fetch_array($kuari)){
?>
<tr>
<td><div align="left"><?echo $hasil['probID'];?></div></td>
<td><div align="left"><?echo $hasil['probName'];?></div></td>
<td><div align="center"><a href="<?echo"EditItem.php?No=$hasil[No]";?>">Edit</a></div></td>
<td><div align="center"><a href="<?echo"deleteCategory.php?No=$hasil[No]";?>" onClick="return confirm('Are you sure you want to Delete data?')">Delete</a></div></td>
</tr>
<? }?>
</table>
</div>
deleteCategory1.php
<html>
<body>
<div id="content">
<div id="leftside">
</div>
<div id="rightside">
<?
include("config.php");
$No=$_GET['caID'];
if($No!="caID")
{
$sql="DELETE FROM category WHERE caID='$No'";
mysql_query($sql);
echo "<script language='JavaScript'>alert('Successfully Deleted!
viewCategory.php
<h1 align="center"><div align="center">
<h3>View Category</h3>
</h1>
<h1 align="center">
<?
include("configure.php");
?>
</h1>
<div align="center">
<table width="778" id="rounded-corner" border="1">
<tr>
<th width="35" class="rounded-company" scope="col"><div align="center"><strong>No</strong></div></th>
<th width="246" class="rounded-company" scope="col"><div align="center"><strong>Category Name</strong></div></th>
<th width="40" class="rounded-company" scope="col"><div align="center"><strong>Edit</strong></div></th>
<th width="57" class="rounded-company" scope="col"><div align="center"><strong>Delete</strong></div></th>
</tr>
<?
$sql="SELECT * FROM category ";
$kuari=mysql_query($sql);
$add=1;
while($hasil=mysql_fetch_array($kuari)){
?>
<tr>
<td><div align="left"><?echo $hasil['caID'];?></div></td>
<td><div align="left"><?echo $hasil['caName'];?></div></td>
<td><div align="center"><a href="<? echo"EditItem.php?No=$hasil[No]";?>">Edit</a></div></td>
<td><div align="center"><a href="<? echo"DeleteCategory1.php?No=$hasil[caID]";?>" onClick="return confirm('Are you sure you want to Delete Category?')">Delete</a></div></td>
</tr>
<? }?>
</table>
</div>
<h1 align="center"><div align="center">
<h3>View Problem</h3>
</h1>
<h1 align="center">
<?
include("configure.php");
?>
</h1>
<div align="center">
<table width="778" id="rounded-corner" border="1">
<tr>
<th width="35" class="rounded-company" scope="col"><div align="center"><strong>No</strong></div></th>
<th width="246" class="rounded-company" scope="col"><div align="center"><strong>Problem Name</strong></div></th>
<th width="40" class="rounded-company" scope="col"><div align="center"><strong>Edit</strong></div></th>
<th width="57" class="rounded-company" scope="col"><div align="center"><strong>Delete</strong></div></th>
</tr>
<?
$sql="SELECT * FROM problem ";
$kuari=mysql_query($sql);
$add=1;
while($hasil=mysql_fetch_array($kuari)){
?>
<tr>
<td><div align="left"><?echo $hasil['probID'];?></div></td>
<td><div align="left"><?echo $hasil['probName'];?></div></td>
<td><div align="center"><a href="<?echo"EditItem.php?No=$hasil[No]";?>">Edit</a></div></td>
<td><div align="center"><a href="<?echo"deleteCategory.php?No=$hasil[No]";?>" onClick="return confirm('Are you sure you want to Delete data?')">Delete</a></div></td>
</tr>
<? }?>
</table>
</div>
deleteCategory1.php
<html>
<body>
<div id="content">
<div id="leftside">
</div>
<div id="rightside">
<?
include("config.php");
$No=$_GET['caID'];
if($No!="caID")
{
$sql="DELETE FROM category WHERE caID='$No'";
mysql_query($sql);
echo "<script language='JavaScript'>alert('Successfully Deleted!