Sorry for the confusion...


I have an application where it organizes candidates for positions for
HR.  There is a Notes field where they can update actions with the
potential candidate.  Now this can be when this person has been
contacted, conversations, or just to say this person is not available,

There may be a point where quotes need to be added to quote a candidate,
or I wanted to give them the option of adding HTML tags to the field so
that when someone looks at the person's record, that the HTML will be
displayed.  It wasn't just the HTML that was causing problems, but the
quotes as well.


If I add..

Joe Blow said "blah blah blah"  the query wouldn't execute.  But if I
did Joe Blow said, blah blah blah, it works fine.

I know HTML isn't as touchy and you can actually do without the quotes,
ie, <font color=red>BLAH</font> it will still display red font.

The weird thing is that I have a Job Posting section and when you update
or edit an exsisting job and add HTML, it works fine without the
addslashes() function, but with the Edit Candidate, it craps out...
Weird, both are practically carbon copies of each other, database field
is both set to "TEXT" and both queries are the same structure.

I cannot figure it out

If you want the URL to look at it, I will send it to you.


-----Original Message-----
From: Paul DuBois [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 10:00 AM
To: Todd Williamsen; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] addslashes()

At 9:53 -0600 2/8/02, Todd Williamsen wrote:
>Going into the database
>Coming out of the database
>Please read the whole post..  8)

I did.  It's not clear, at least to me, what you're trying to do.
You say "print" at one point and "insert into database" at another

I'm pretty sure I know the solution.  What's not clear to me is
the *problem*.

Where are the data coming from?  Are you generating it within the
Are you receiving it as the contents of a web form?

What are you doing with that data?  Printing it?  Storing it into the
database?  Storing it into the database so that you can print it as
a Web page later?

>-----Original Message-----
>From: Paul DuBois [mailto:[EMAIL PROTECTED]]
>Sent: Friday, February 08, 2002 9:40 AM
>To: Todd Williamsen; [EMAIL PROTECTED]
>Subject: Re: [PHP-DB] addslashes()
>At 9:14 -0600 2/8/02, Todd Williamsen wrote:
>>So if I:
>>Going in
>>$Notes =  addslashes($Notes);
>>Going Out:
>>$Notes = stripslashes($Notes);
>>wouldn't that kill the html? or no?
>I have no idea.  What do you mean by "in" and "out"?
>What exactly are you trying to do?  Are you generating HTML for
>a Web page, storing data in a database, or are you trying to store
>HTML in your database?
>>"Joe Van Meer" <[EMAIL PROTECTED]> wrote in message
>>>   Hi. addslashes() going in to db, stripslashes() coming out :)
>>>    HTH Joe :)
>>>   Todd Williamsen <[EMAIL PROTECTED]> wrote in message
>>>   002601c1b033$382a4700$f6b2d83f@goofy1">news:002601c1b033$382a4700$f6b2d83f@goofy1...
>>>   > Paul,
>>>   >
>>>   > It is being inserted into a database
>>>   >
>>>   > -----Original Message-----
>>>   > From: Paul DuBois [mailto:[EMAIL PROTECTED]]
>>>   > Sent: Thursday, February 07, 2002 5:41 PM
>>>   > To: Todd Williamsen; [EMAIL PROTECTED]
>>>   > Subject: Re: [PHP-DB] addslashes()
>>>   >
>>>   >
>>>   > At 16:54 -0600 2/7/02, Todd Williamsen wrote:
>>>   > >Ok..
>>>   > >
>>>   > >i tried it out... and it almost works like I want it... weird
>>>   > >
>>>   > >1. when I put in <p><font color="blue">this is BLUE</p></font>
>>>   > >
>>>   > >it prints it in like a bright green.  but if i use the RGB #
>>>   > fine.
>>>   > >weird....
>>>   > >
>>>   > >2.  if there is an apostrophe in the notes, then it will add
>slashes it
>>>   > to
>>>   > >that as well
>>>   > >
>>>   > >so if I type blah blah blah I am going over to my friend's
>>>   > later on
>>>   > >and here is the address...
>>>   > >
>>>   > ><a href=">Friends</a>
>>>   > >
>>>   > >it will look like
>>>   > >
>>>   > >friend\\\'s
>>>   > >
>>>   > >Friends(link)
>>>   >
>>>   > addslashes() is for escaping values that you're going to insert
>into a
>>>   > database.
>>>   >
>>>   > If you're generating HTML, use htmlspecialchars() instead.
>>>   >
>>>   >
>>PHP Database Mailing List (
>>To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to