|
Posted by tritone on 06/28/07 21:06
Thanks. I thought that it might be as simple as that, but it's hard to
search through documentation for a feature that doesn't exist!
On Jun 28, 1:10 pm, ZeldorBlat <zeldorb...@gmail.com> wrote:
> On Jun 28, 2:41 pm, tritone <mike...@gmail.com> wrote:
>
> > $sql = "DELETE FROM " . $mosConfig_dbprefix . "foo WHERE foo_id = '" .
> > mosGetParam($_POST, 'cid', '' )[$a] . "'";
>
> > was throwing errors and I fixed it be doing this:
>
> > $cidx = mosGetParam( $_POST, 'cid', '' );
> > $sql = "DELETE FROM " . $mosConfig_dbprefix . "foo WHERE foo_id = '" .
> > $cidx[$a] . "'";
>
> > My question is why didn't the first version work and is there a way to
> > code it without adding the intermediate variable?
>
> It doesn't work because that syntax is not supported by PHP.
>
> You could make it work by creating another function (mosGetParamNum or
> something) that "wraps" you current mosGetParam and takes the index as
> an additional parameter.
Navigation:
[Reply to this message]
|