-
-
if(isset($_POST['add']))
-
{
-
$title = $_POST['title'];
-
$content_news = $_POST['content_news'];
-
$forward_link = $_POST['forward_link'];
-
-
$res = mysql_query("INSERT INTO news (title, content_news, forward_link)
-
VALUES ('" . $title . "', '". $content_news ."', '". $forward_link ."')");
-
-
if ( !$res )
-
{
-
echo("SQL Error: ". mysql_error());
-
}
-
}
-
-
if(isset($_POST['delete']))
-
{
-
mysql_query("delete from news where email='".$id."'");
-
-
}
-
-
-
-
-
-
$query="SELECT * FROM news";
-
$result=mysql_query($query);
-
$num=mysql_numrows($result);
-
-
-
mysql_close($dbh);
-
-
?>
-
-
-
-
-
-
-
Computer Museum -
-
-
-
-
Add News
-
-
-
Title Passage: Link -
-
-
Title Content Link $i=0;while ($i < $num) {$id=mysql_result($result,$i,"id");$title=mysql_result($result,$i,"title");$content_news=mysql_result($result,$i,"content_news");$forward_link=mysql_result($result,$i,"forward_link");?>echo $title; ?> echo $content_news; ?> $i++;}echo "?>
PermaLink to this entry https://pastebin.co.uk/12166
Posted by Anonymous Sat 24th Mar 2007 04:45 - Syntax is None/text - 29 views
Download | New Post | Modify | Hide line numbers
Posted by Anonymous Sat 24th Mar 2007 04:45 - Syntax is None/text - 29 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Description:
trying to delete items but it wont work for some reason. i know that it calls
the right things and gets to the if statement but not sure what happens next.
the add feature works fine.
trying to delete items but it wont work for some reason. i know that it calls
the right things and gets to the if statement but not sure what happens next.
the add feature works fine.
Comments: 0