Re: Re: Spaces Problem php & mysql
| From: | szii at sziisoft dot com | Date: | Thu, 02 May 2002 17:10:46 +0000 |
| Subject: | Re: Re: Spaces Problem php & mysql | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18950@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Hugh Bothwell" <hugh_bothwell@hotmail.com>
To: <php-db@lists.php.net>
Sent: Thursday, May 02, 2002 6:23 AM
Subject: [PHP-DB] Re: Spaces Problem php & mysql
> > 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' )
Make sure you escape out all single quotes in $name.
$name = " This is Paul's field."
.
.
.
INSERT INTO table ( name ) VALUES ( '$name' )
Will fail, because you have VALUES ('This is Paul');
Post the full value of $name via var_dump($name) and
var_dump($query) and we'll see what we can find with it.
'Luck
-Szii