Quantcast
Channel: News script inserting news data, but not editing news - Stack Overflow
Viewing all articles
Browse latest Browse all 3

News script inserting news data, but not editing news

$
0
0

So I've got this code working so it can insert news into it's table, but the problem is the editing news afterwards if need be.

I've been trying different ways, but it seems to not be working full stop.

<? if(!$id)echo("Please choose a page to edit..");elseif($id==edit){$select = mysql_query("select * from news where newsid = '$id'");$article = mysql_fetch_array($select);?><form action="edit-news.php?id=edited" method="post">    Title:<br /><input name="readuser" type="text" value="<? echo("$article[title]");?>" size="70" />Article Content:<br /><textarea name="pageuser" cols="40" rows="6"><? echo("$article[text1]");?></textarea><br /><br /><input type="submit" value="Update article" /></form><?}elseif($page==edited){$text1 = $_POST[pageuser];$title = $_POST[readuser];$updateit = mysql_query("update news set text1 = '$text1' AND title = '$title' where newsid = $id");echo("Article updated");}?>

I get no error messages when visiting the page anymore (thankfully!!!) but it's just not editing the articles.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images