Re: updating pages with php

From: Date: Wed, 05 Mar 2003 19:21:56 +0000
Subject: Re: updating pages with php
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-138344@lists.php.net to get a copy of this message
Before you save the paragraph into the db, use the addslashes() function like this: $textVar = addslashes($textVar); That escapes all the characters like commas, return and whatever else MySQL may have trouble with. The reverse the process before you display it: nl2br(stripslashes($textVar)) The nl2br() function will change all new lines (returns) to the html equivalent <br />. On Wednesday, March 5, 2003, at 01:19 PM, Tyler Durdin wrote:
I have a web page with a simple introductory paragraph on it. I was going to store the paragraph in a mySQL DB and create an administration page so people could easily edit the paragraph itself or change it all together. The problem I ran into is that mySQL will not allow certain punctuation inside of a record (no comma's). So now I am left trying to figure out how I can have the user update the paragraph without having it in a db. Can someone shoot me in the proper direction? Thanks in advance, your help is greatly appreciated. bk _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --
Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577

« previous php.general (#138344) next »