#26297 [Opn->Bgs]: Function redeclare
| From: | daniel at cyberprune dot com | Date: | Tue, 18 Nov 2003 09:58:53 +0000 |
| Subject: | #26297 [Opn->Bgs]: Function redeclare | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-50610@lists.php.net to get a copy of this message | ||
ID: 26297
User updated by: daniel at cyberprune dot com
Reported By: daniel at cyberprune dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.3.4
New Comment:
Found problem
Previous Comments:
------------------------------------------------------------------------
[2003-11-18 04:52:07] daniel at cyberprune dot com
Description:
------------
Fatal error: Cannot redeclare get_total_topics() (previously declared
in
/vhost/rollo/rollo.cyberprune.com/portal/exoops/modules/newbb_plus/functions.php:2)
in
/vhost/rollo/rollo.cyberprune.com/portal/exoops/modules/newbb_plus/functions.php
on line 2
Reproduce code:
---------------
<?php
function get_total_topics($forumid)
{
global $db, $bbTable;
if ($forum_id) {
$sql = "SELECT COUNT(*) AS total FROM ".$bbTable['topics']." WHERE
forum_id = '$forum_id'";
} else {
$sql = "SELECT COUNT(*) AS total FROM ".$bbTable['topics'];
}
if (!$result = $db->query($sql)) {
return(_ERROR);
}
if (!$myrow = $db->fetch_array($result)) {
return(_ERROR);
}
return($myrow['total']); }
Expected result:
----------------
Function to work
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26297&edit=1