Re: Problem - Insert data into mysql

From: Date: Wed, 06 Dec 2000 14:37:13 +0000
Subject: Re: Problem - Insert data into mysql
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-5048@lists.php.net to get a copy of this message
you need to escape any extra quote that does not have a closing quote with a BACKSLASH. $test1 = "We\'re going to town" other wise PHP will try to find the pair, and unable to do so will give you a parsing error. ""Ian"" <hee@b163.com> wrote in message news:90kt5s$ead$1@toye.p.sourceforge.net... > Hi ; ) > > I'm facing a problem when I input/enter a sentence with special character > like '. > Examples : - > $test1 = "We're going to town > est2 = "We are going to town > > My HTML form tag. > <textarea name="test' rows="5" cols="40"></textarea> > > My PHP $sql statement like below:- > $sql = "INSERT INTO > demo(id,name,info) > values('$id','$name','$test1')"; > > I can't insert data $test1 into mysql database, but data $test2 is NO > PROBLEM. > > Could anybody help me !!!!! > Any help would be apreciate. > > > Kind regards, > Hee. > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#5048) next »