query("SELECT * FROM `".$config->database['prefix']."chapters` WHERE `id`=".mysql_real_escape_string(stripslashes($_GET['chapid']))); if (mysql_num_rows($result) == 1) { $chapter = mysql_fetch_assoc($result); if (isset($_POST['submit'])) { if (stripslashes(trim($_POST['name'])) != '' && stripslashes(trim($_POST['book'])) != '0' && stripslashes(trim($_POST['chapter'])) != '' && stripslashes(trim($_POST['contents'])) != '') { mysql_real_escape_string($_POST['data']); $db->query("UPDATE `".$config->database['prefix']."chapters` SET `title`='".mysql_real_escape_string(stripslashes($_POST['name']))."', `book`='".mysql_real_escape_string(stripslashes($_POST['book']))."', `chapter`='".mysql_real_escape_string(stripslashes($_POST['chapter']))."', `contents`='".mysql_real_escape_string(stripslashes($_POST['contents']))."' WHERE `id` = ".mysql_real_escape_string(stripslashes($_GET['chapid']))." LIMIT 1"); $db->log($_SESSION['tt-admin-username'], 'Edited Chapter: '.$_POST['name']." (".mysql_insert_id($link).")"); ?>

Success!

The chapter was successfully edited!

An Error has Occured!

You cannot leave any fields in the form blank!

Editing chapter:

/>
/>

An Error has Occured!

The specified chapter id does not exist.

An Error has Occured!

You dolt! Please specify the chapter id that you want to edit!