Re: Spaces Problem php & mysql
| From: | Hugh Bothwell | Date: | Thu, 02 May 2002 13:23:05 +0000 |
| Subject: | Re: Spaces Problem php & mysql | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18942@lists.php.net to get a copy of this message | ||
"Paul" <pauljw22@pacbell.net> wrote in message
news:0GVG00AEJRR7P8@mta6.snfc21.pbi.net...
> I have a form on one server which takes a name in one field, intentionally
> including spaces as a full name. That value shows up as a form variable as
I
> intended when I display it on the same server. It is sent to another
server
> and written to a mysql database there. At that time, only the first word
in
> the field is written. When the value is returned by the same php script
that
> received and wrote the database, the only thing left in the field is the
> first word. Length of the word seems to have nothing to do with this.
>
> I've been pounding my head (and the keyboard with searches) over this. Do
I
> have to take the first entry apart with string functions to get my desired
> end, which is the entire name in one field in the database?
... make sure the value is enclosed in quotes when you try
to insert it into the database, ie
INSERT INTO table ( name ) VALUES ( '$name' )