PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
lazersam
Forum Contributor
Posts: 105 Joined: Sat Nov 15, 2003 4:07 am
Location: Hertfordshire, UK
Post
by lazersam » Tue Apr 19, 2005 8:22 am
Hi - I'm not really a newbie but I have a newbie problem...
I have placed this html code into a variable ($default_personal_text_1) and want to put it into a database...
Code: Select all
<p align="e;center"e;>Get a site like this one and MAKE $$$ Every Single Day! I will
personally help you to $uccess!</p>
problem is the php is reading the html as part of the php code and not as the variable that it is...
Code: Select all
$sql = "update profile set personal_text_1 = \"$default_personal_text_1\"")";
Any suggestions?
Larry
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Apr 19, 2005 8:27 am
mysql_real_escape_string() or mysql_escape_string()
lazersam
Forum Contributor
Posts: 105 Joined: Sat Nov 15, 2003 4:07 am
Location: Hertfordshire, UK
Post
by lazersam » Tue Apr 19, 2005 8:39 am
Thanks fyed... i tried 'addslashes' and it works!
Regards
Larry.