Insert html content as a value into mysql database? [message #168258] |
Mon, 25 March 2013 04:13 |
Jack Hard
Messages: 7 Registered: December 2012
Karma:
|
Junior Member |
|
|
can someone please help, i am wanting to insert some html text WITH LINE BREAKS into the database as a value, but when i add in line breaks it causes the query to fail, i think this is becuase mysql doesnt support html line breaks
can someone show me a way i can keep my text structure with line breaks and get the query working thanks.
the value that's giving me trouble is the 'content'.
$query="INSERT INTO ptb_messages (id,
from_user_id, to_user_id, subject, content)
VALUES('NULL',
'1',
'".$_SESSION['user_id']."',
'Welcome...',
'Hi There ,<br/><br/>
Welcome to your brand new, sparkling profile. We're so excited to have you with us! We just wanted to check in on you to see how you were getting on, and to let you know that if you have any questions or comments for us then please do not hesitate to get in touch at Support(at)fixstructure(dot)com.<br/><br/>
fixstructure.com is a fun, friendly and clean community, please help us keep it this way. We want you to enjoy your new profile to the maximum but there are a few do's and dont's, for more information checkout our Terms and User Policy under the help link in your Account Settings menu.<br/><br/>
That's pretty much everything, so thanks once again for joining the fixstructure.com community and we look forward to seeing more of you and watching your new profile grow in the future.<br/><br/>Regards,<br/>The fixstructure Team'
)";
mysql_query($query) or die('error');
|
|
|