SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

g.farmer
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.

<?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

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2079 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
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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