Re: Re: Spaces Problem php & mysql
| From: | szii at sziisoft dot com | Date: | Thu, 02 May 2002 23:37:19 +0000 |
| Subject: | Re: Re: Spaces Problem php & mysql | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18955@lists.php.net to get a copy of this message | ||
AddSlashes() or AddCSlashes()
-Szii
----- Original Message -----
From: "Paul" <pauljw22@pacbell.net>
To: <szii@sziisoft.com>
Sent: Thursday, May 02, 2002 4:11 PM
Subject: Re: [PHP-DB] Re: Spaces Problem php & mysql
> On Thursday 02 May 2002 10:10 am, you wrote:
> > ----- 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
> Thank you David and Szii. The urlencode solved the sending problem. But I've
> had in the back of my mind to remember to deal with apostrophe's in names for
> some time and just haven't done it. Good reminder. Is there any easier way to
> do this than looping through each character in a string?
>
> Paul