Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Include line breaks
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 02/06/2013 :  12:28:09  Show Profile  Reply with Quote
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.


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

Flowing Fount of Yak Knowledge

United Kingdom
2179 Posts

Posted - 02/07/2013 :  01:45:04  Show Profile  Visit jackv's Homepage  Reply with Quote
It might be worth asking this question at a PHP forum ,

Jack Vamvas
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000