Hi,
I built a comments system,
basically the comments appear underneath the form once submitted and page is refreshed, everything works like it should.
I have this piece of code below, what i am having difficulty in is first time it worked then it no longer works.
<?php
$bannedwordquery = mysql_query( "SELECT * FROM `post_comment_banned_words`");
while( $row = mysql_fetch_array( $bannedwordquery ) ) {
$replacementword = "banned word";
$comment = str_ireplace($row['banned_words'], $replacementword, "".$_POST['comment']."" );
}
?>
for some reason it worked first time and words in DB came up as banned word like it suppose to and now it does not filter the banned words, i did not change anything since creating it earlier when it was working hence why i am so confused.
Can anyone tell me what might be the problem is please?
here is my DB table for the banned words:
- Table structure for table `post_comment_banned_words`
--
CREATE TABLE IF NOT EXISTS `post_comment_banned_words` (
`id` int(11) NOT NULL auto_increment,
`banned_words` varchar(15) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=66 ;
I am baffeled.
Thanks
GUK