You are here: [HELP] trying to pass by reference to an optional function parameter « PHP Programming Language « IT news, forums, messages
[HELP] trying to pass by reference to an optional function parameter

Posted by John T on 06/07/05 09:24

I am trying to make a function that takes an optional parameter that gets
passed by reference.

Here is the first line of my function definition:

function funQueryDatabase($strQuery, &$intInsertId = NULL) {

I am getting this error:

Parse error: parse error, expecting `')'' in c:\program
files\easyphp1-8\www\my_query_database_function.php on line 7

Line 7 is the first line of my function definition (above).

If I take out the & or if I take out the = NULL, then the error goes away,
but of course it doesn't do what I want.

Is it not possible to have an optional pass-by-reference parameter, or is
there another value that I should use for the default value?

Thanks very much for any help you can give.

JT
johntutton@yahoo.com__nospam

 

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

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