AddSlashes() or AddCSlashes()

-Szii

----- Original Message ----- 
From: "Paul" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > 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


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to