Forum Moderators: coopster
/[\r\n]{2,}?/m wasn't recognising line breaks straight from a textarea, so an input like this: Oranges
And
Apples
Oranges\r\n\r\n\r\n\r\nAnd\r\n\r\n\r\n\r\nApples
$content = mysql_real_escape_string($_POST['content']);
$content = preg_replace($symb, $repl, $content);
echo $content; $content = mysql_real_escape_string($_POST['content']);
$prev_ins_sql = "INSERT INTO post_preview (n_content) VALUES('$content')";
mysql_query($prev_ins_sql);
$prev_ret_sql = 'SELECT * FROM post_preview WHERE n_content="' . $content . '"';
$prev_result = mysql_query($prev_ret_sql);
$prev_content = preg_replace($symb, $repl, mysql_result($prev_result,0,"n_content"));
$prev_id = mysql_result($prev_result,0,"n_id");
$prev_del_sql = 'DELETE FROM post_preview WHERE n_id="' . $prev_id . '"';
mysql_query($prev_del_sql);
echo $prev_content;