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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: daniel at cyberprune dot com
New email:
PHP Version: OS:

 

 [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: Sat Jun 01 21:01:29 2024 UTC