i make this function to replace strings in a text, from a database:

PHP Code:
function form_filter($text) {
    
$sql "SELECT * FROM `form_filter`";
    
$query mysql_query($sql);
    while(
$a mysql_fetch_array($query)) {
        
$new str_replace($a['replace'], $a['with'], $text);
    }
    return 
$new;

and it doesnt work. can some one help?