Hi
about 7 days am experiencing this problem if you can help me out this is the code; it's not updating at all it's just redirecting me to the page this is my code
function editcat($cid,$catname,$catdesc,$ok=false) {
global $db;
$id = intval($cid);
$result = $db->query("SELECT * FROM category WHERE cid='$cid'");
$row = $result->fetch_array();
$cid = $row['cid'];
$catname = $row['catname'];
$catdesc = $row['catdesc'];
if (!$ok) {
echo "<table width='100%' align='center' cellspacing='0' cellpadding='1'>\n";
echo "<form name='form_arg' method='post' action='index.php?page=articles&op=editCategory&cid=$id&ok=true'>";
echo "<tr><td width='25%'><b>Name</b><td><input type='text' name='catname' size='40' maxlength='255' value=\"$catname\">\n";
echo "<tr><td><b>catdescription</b><td><input type='text' name='catdesc' size='40' maxlength='255' value=\"$catdesc\">\n";
echo "<tr><td colspan='2'><input type='submit' name='Submit' value='Modify'>\n";
echo "</form>\n";
echo "</table>\n";
} else {
$save = true;
if ($catname=="") { $save = false; $msg = "Name field is empty!";}
if ($catdesc=="") { $save = false; $msg = "catdescription field is empty!";}
if($save){
$stmt = $db->stmt_init();
$stmt = $db->prepare("UPDATE category SET catname=?,catdesc=? WHERE cid=?");
$stmt->bind_param('ssi',$catname,$catdesc,$cid);
$stmt->execute();
$stmt->close();
echo "<meta http-equiv='refresh' content='0;URL=index.php?page=articles'>";
}else{
echo "<div align='center' id='errorText'><b>$msg</b></div>";
}
}
}