Jump to content
Killersites Forums

afaaro

New Members
  • Posts

    1
  • Joined

  • Last visited

afaaro's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hello everyone about 4 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 $db = new mysqli($dbHost, $dbUser, $dbPass, $dbName) or die (mysql_error()); function editcat($cid,$name,$desc,$ok=false) { global $db; $cid = intval($cid); if (!$ok) { $result = $db->query("SELECT * FROM category WHERE cid='$cid'"); $row = $result->fetch_object(); $cid = $row->cid; $name = $row->name; $desc = $row->desc; echo "<table width='100%' align='center' cellspacing='0' cellpadding='1'>\n"; echo "<form name='form_editcat' method='post' action='index.php?page=articles&op=editCategory&cid=$cid&ok=true'>"; echo "<tr><td><b>Name</b><td><input type='text' name='name' size='40' maxlength='255' value=\"$name\">\n"; echo "<tr><td><b>Description</b><td><input type='text' name='desc' size='40' maxlength='255' value=\"$desc\">\n"; echo "<tr><td colspan='2'><input type='submit' name='Submit' value='Modify'>\n"; echo "</form>\n"; echo "</table>\n"; } else { $save = true; if ($name=="") { $save = false; $msg = "Name field is empty!";} if ($desc=="") { $save = false; $msg = "Description field is empty!";} if ($save) { $db->query("UPDATE category SET name='$name',desc='$desc' WHERE cid='$cid'"); echo "<meta http-equiv='refresh' content='0;URL=index.php?page=articles'>"; } else { echo "<div align='center' id='errorText'><b>$msg</b></div>"; } } }
×
×
  • Create New...