Bug #17586 Updated: Odd Functions/Global

From: Date: Tue, 04 Jun 2002 01:17:19 +0000
Subject: Bug #17586 Updated: Odd Functions/Global
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9406@lists.php.net to get a copy of this message
ID: 17586 Updated by: sniper@php.net Reported By: rgldman@aol.com -Status: Open +Status: Bogus Bug Type: Output Control Operating System: Win32/ME PHP Version: 4.2.1 New Comment: Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2002-06-03 20:56:29] rgldman@aol.com Webserver: Apache 2.0.36 / PHP 4.2.1(module) / register_globals = Off Kind of difficult to explain so here you have it. (This is not the exact script but structure.) **OCCURANCE #1 ---mysql.php--- $dbhost = "localhost"; $dbuser = "user"; ... function dbconnect() { global $dbhost, $dbuser if (!mysql_connect($dbhost, $dbuser,...)) { die..} else if (!mysql_select_db(...)) { die..} else { print "connection ok"; } } dbconnect(); ---end mysql.php--- I ran this script throug my browser, it worked. **OCCURANCE #2 ---mysql.php--- $dbhost = "localhost"; $dbuser = "user"; ... function dbconnect() { global $dbhost, $dbuser if (!mysql_connect($dbhost, $dbuser,...)) { die..} else if (!mysql_select_db(...)) { die..} else { print "connection ok"; } } ---end mysql.php--- ---test.php--- require "mysql.php"; dbconnect(); ---end test.php--- No result. **OCCURENCE #3 ---mysql.php--- $dbhost = "localhost"; $dbuser = "user"; ... function dbconnect() { global $dbhost, $dbuser if (!mysql_connect($dbhost, $dbuser,...)) { die..} else if (!mysql_select_db(...)) { die..} else { print "connection ok"; } } dbconnect(); ---end mysql.php--- Nothings happens, although #1 and #3 are exact. I should have received the same result if the scripts are exact, right? I am confused. This was within one minute time span. I don't know if this is a bug or really matters at all but something doesn't seem right, and that gets annoying. PHP 4.2.1 is very annoying. I lub PHP --all $_GET, $_POST, globals, ETC. make me sick. :0`', I do not understand why #1 was successfull in the first place, with global $vars;. Sincerely, RG. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17586&edit=1

« previous php.bugs (#9406) next »