heres a random edit page I created due to bordem
untested.
<?php
include('dbconnect.php'); //connects to database
//select the table
$result = mysql_query("select * from newscms order by id desc LIMIT 5 ");
//grab all the content from the table
while($r = mysql_fetch_array($result))
{
$id = $r['id'];
$title = $r['title'];
$date = $r['date'];
$user = $r['user'];
$icon = $r['icon'];
$message = $r['message'];
}
// the input fields for editing
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<h1>Edit Tutorial #<?php echo $row[0]; ?></h1>
<input type="hidden" name="id" value="<?php echo $id; ?>">
<h2>Title</h2>
<input name="title" type="text" value="<?php echo $title ?>" size="50"><br>
<h2>Date</h2>
<input name="date" type="text" value="<?php echo $date ?>" size="50">
<h2>User</h2>
<input name="user" type="text" value="<?php echo $user ?>" size="50"><br><br>
<h2>Icon</h2>
<input name="icon" type="text" value="<?php echo $icon ?>" size="50"><br><br>
<h2>Message</h2>
<textarea name="message" cols="80" rows="30"><?php echo $message ?></textarea>
<p>
<input name="submit" type="Submit" value="Submit">
<input type="reset">
</p>
</form>
<?php
{
$id = $_POST['id'];
$title = $_POST['title'];
$date = $_POST['date'];
$user = $_POST['user'];
$icon = $_POST['icon'];
$message = $_POST['message'];
$query = "UPDATE tutorials SET name = '".$id."', keywords = '".$title."', avatar = '".$date."', category = '".$user."', skill = '".$icon."', brief = '".$message."' WHERE id = '".$id."'";
$result = mysql_query($query)or die(mysql_error());
echo 'News item successfully edited.';
}
mysql_close($connection);
?>
ps. nice script