mysql - PHP Cannot redeclare function after file name changed -
i'm getting error
fatal error: cannot redeclare getallstaff() (previously declared in /applications/xampp/xamppfiles/htdocs/stafftools/database/staffhandler.php:5) in /applications/xampp/xamppfiles/htdocs/stafftools/database/staffhandler.php on line 15
i'm building application in apatana studio 3 , renamed file staffhandler.php
staffhandler.php
(uppercase s) former no longer exists.
i php files database
directory using below php code
foreach(glob("database/*.php") $filename) { include $filename; }
and call method called getallstaff()
here:
<select name="staff"> <?php getallstaff(); ?> </select>
obviously, method in staffhandler.php
. working fine until changed filename of name.
things i've tried
- clearing cache in firefox
- rebuilding & cleaning project in aptana
- changing filename
staffhandler.php
- conditional function statemet
if(!function_exists....
why on earth php throw error file doesn't exist anymore?
update: resolved
i had reference staffhandler.php file buried within php scripts , think source of problem. when ran ls -la
@ terminal in database directory staffhandler.php
appeared when ran find staffhandler.php , rm staffhandler.php
erased both staff , staff. must've been kind of link between created application code.
Comments
Post a Comment