Posted by toddism on 06/20/06 17:35
Thank you much. I assumed it was OK but wasn't sure if there was
something subtle.
Sjoerd wrote:
> toddism wrote:
> > $clean = array();
> > $mysql = array();
> >
> > $clean['last_name']="o'reilly";
> > $mysql['last_name']=mysql_real_escape_string($clean['last_name']);
> >
> >
> > why are we using an array ( $mysql['last_name'] ) instead of just a
> > variable: $val?
>
> It will work with just a variable. An array is probably used because
> you want to insert more than only the last name:
>
> $clean = array("last_name" => "o'reilly", "first_name" => "Bill", "And"
> => "so on");
> $mysql = array();
> foreach ($clean as $key -> $value) {
> $myqsl[$key] = mysql_real_escape_string($value);
> }
Navigation:
[Reply to this message]
|