[thelist] [php] cannot redeclare function error

Jason Handby jasonh at pavilion.co.uk
Mon Feb 10 15:43:01 CST 2003

> I am getting an error with one function :
> "*Fatal error*: Cannot redeclare getuser() in */<file
> path>/includes/databaseFunctions.php* on line *20*"
> when databaseFunctions.php is included.
> There are two possible errors that cause this error (that I know of)
> (1) The function is being defined twice - this is not happening with
> mine, as it only occurs *once* in all 4 files that the script involves.
> (2) It is a reseved built in function name for an already existing php
> function - the function name i am using is "getUser()". I have scoured
> the manual and have found no match.
> The function does not call itself, which I thought could also cause the
> error. Does anyone have any suggestions?

Try calling it something else! That way at least you'll know which of your
two cases you're dealing with... :-)


More information about the thelist mailing list