For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > August 2005 > Adding "'s to a $_POST value?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Adding "'s to a $_POST value?
Ant

2005-08-12, 5:00 pm

Hi,

I'm a bit of a newbie to php.

I have some values that I'm getting via the post method which I want to
include in an sql statement - the problem is I need to enclose the value in
"'s but I dont know how.

e.g $id = $_POST["id"];

so, if $id = monkey I want to turn it into "monkey"

Any help much appreciated - I'm sure it's something obvious and I'm just
being thick.


Ant

2005-08-12, 5:00 pm

you can stop replying now as I've workied it out


Norman Peelman

2005-08-12, 10:26 pm

"Ant" <nospam@allthanks.com> wrote in message
news:ddifv0$1ip$1@wisteria.csv.warwick.ac.uk...
> Hi,
>
> I'm a bit of a newbie to php.
>
> I have some values that I'm getting via the post method which I want to
> include in an sql statement - the problem is I need to enclose the value

in
> "'s but I dont know how.
>
> e.g $id = $_POST["id"];
>
> so, if $id = monkey I want to turn it into "monkey"
>
> Any help much appreciated - I'm sure it's something obvious and I'm just
> being thick.
>
>


Let us know how you worked it out as someone might have even a better
way...

Norm
---
FREE Avatar hosting at www.easyavatar.com



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com