php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26297 Function redeclare
Submitted: 2003-11-18 04:52 UTC Modified: 2003-11-18 04:58 UTC
From: daniel at cyberprune dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.4 OS: Linux
Private report: No CVE-ID: None
 [2003-11-18 04:52 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-18 04:58 UTC] daniel at cyberprune dot com
Found problem
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 03 08:01:30 2024 UTC