Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2000121

Re: [PHP-DB] Problem - Insert data into mysql From: Daniel Rezny (dr <email protected>)
Date: 12/06/00

Hello Ian,

Wednesday, December 06, 2000, 9:22:58 AM, you wrote:

I> Hi ; )

I> I'm facing a problem when I input/enter a sentence with special character
I> like '.
I> Examples : -
I> $test1 = "We're going to town
I> est2 = "We are going to town

I> My HTML form tag.
I> <textarea name="test' rows="5" cols="40"></textarea>

I> My PHP $sql statement like below:-
I> $sql = "INSERT INTO
I> demo(id,name,info)
I> values('$id','$name','$test1')";

I> I can't insert data $test1 into mysql database, but data $test2 is NO
I> PROBLEM.

I> Could anybody help me !!!!!
I> Any help would be apreciate.

I> Kind regards,
I> Hee.

Try to use a addslashes() function. I think the "'" makes a problem.

Hope it helps

-- 
Best regards,
 Daniel                            mailto:dr <email protected>

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>