|
g.farmer
Starting Member
1 Posts |
Posted - 02/06/2013 : 12:28:09
|
Hi everyone
I am wondering if you could help. I have zero experince with both SQL & PHP.
I have put together a webform. When a user puts the text in the text area and creates a new paragraph using the the return key, it ends up in my databas as one line and so is bieng outputted as one line.
I am getting the following error
Warning: Wrong parameter count for str_replace() in /home/a2417904/public_html/joybells/posted1.php on line 12
I have spent the last few days looking on line but have ony found the solution which has not worked. Here is my code.
<?php
include ('connections/connect.php');
$title = $_POST['title']; $content = $_POST['content']; $author = $_POST['author'];
$new_blog = "INSERT INTO Blog (Title, Content, Author, Date) VALUES ('$title', '$content', '$author', CURDATE())"; $enter_query = mysql_query($new_blog) or die (mysql_error()); $new_blog = str_replace("<br />","\n");
?>
The line in question is in bold.
Any help would be appreciated.
Many thanks |
|