Word filter problem


Posted on 16th Feb 2014 07:03 pm by admin

Hello,

im trying to make a filter for words inputted in to my website but i want to store the swear word and the replacement for that word in a mysql db i have developed the code below;

Did you know?Explore Trending and Topic pages for more stories like this.
<?php

include("config.php");


$str = 'how are you have you got any money';




$result = mysql_query("SELECT * FROM table")
or die(mysql_error());

while($row = mysql_fetch_array( $result )) {
$words = array($row['word'],);
$filter = array($row['translated_word'],);


}
echo str_replace($words, $german, $str);
?>

but it just dose not return the filters how i need it to it will only list it as it returns them like

wordwordwordwordword

but i need it to return them like

word,word,word,word,word

how would i do this? please help me =] thanks
No comments posted yet

Your Answer:

Login to answer
209 Like 24 Dislike
Previous forums Next forums
Other forums

Baffled by Undefined Index in Simple Array: Please Help!
Hello. I have a form which posts an array to this script. However, I can't seem to access the values

registration form
first time posting. did some searches but didnt find exactly what i am looking for. dont flame cause

Help on query replacing the date
Hi Pals,

i want to replace the current date in a column to some value say C or D or any n

"SEO" URLs
Hey, I'm wondering how to go about creating and using these types of URLs. I'm presuming it's PHP th

Why use OOP?
Can someone explain to me why I should use OOP instead of procedure based code.

Im building a

Need help with an email blocker for a guessbook
I am new with php and here is a simple guessbook page but I am being hit with spam from a group of t

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

Filtering an Array Based on Value
I have a very simple script set up that pulls data from a database and is output using this code:

word wrap in emails help needed
Hello, I understand how wordwrap works in php and have used it well before. However when I used wor

Linking with Foreign Keys
I have been getting an erro when I try and link:

create table Faculty_Specialty (I_Name v

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash