Reply to Re: question about arrays and functions

Your name:

Reply:


Posted by ZeldorBlat on 06/28/07 20:10

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.

[Back to original 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

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