[SOLVED] Newbie question

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

Post Reply
User avatar
lazersam
Forum Contributor
Posts: 105
Joined: Sat Nov 15, 2003 4:07 am
Location: Hertfordshire, UK

[SOLVED] Newbie question

Post by lazersam »

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=&quote;center&quote;>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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

mysql_real_escape_string() or mysql_escape_string() :?:
User avatar
lazersam
Forum Contributor
Posts: 105
Joined: Sat Nov 15, 2003 4:07 am
Location: Hertfordshire, UK

Post by lazersam »

Thanks fyed... i tried 'addslashes' and it works!

Regards

Larry.
Post Reply