You are here: Re: question about arrays and functions « PHP Programming Language « IT news, forums, messages
Re: question about arrays and functions

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация