Re: Inserting with whitespace (D'OH!)

From: Date: Tue, 18 Jul 2000 02:32:07 +0000
Subject: Re: Inserting with whitespace (D'OH!)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7003@lists.php.net to get a copy of this message
On 17 Jul, Daniel Dean wrote: > Oops, I forgot to add "VALUES" in the message. Here is the actual code... > > $query = "INSERT INTO table_name VALUES('$message_variable')"; > mysql_db_query("database", $query); > > Is there some formatting restriction or a setting that would cause this to > just store the first string of non-whitespace text out of $message_variable? > > Dan You need to urlencode($message_variable) before sending it from the source script to this script, and urldecode it before inserting in the database. Cheers -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#7003) next »