|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-03 21:17 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 08:00:02 2025 UTC |
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.