|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-06-30 14:37 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ The global variable isnt being assigned the mysql connection resource id. This worked fine with PHP3 and 4. Notes: * Ive noticed that using anything like: $$varname = "GOODBYE"; ... assigns correctly, only with mysql_connect() the assignment is ignored. * If you remove the global declaration and use: $GLOBALS[$varname] = mysql_connect(); .. it works. Reproduce code: --------------- <?php function checkme($varname = 'var') { global $$varname; $$varname = mysql_connect("your", "data", "here"); } $var = 'HELLO'; checkme(); echo $var; // Should be a resource_id, but its "HELLO" ?> Expected result: ---------------- Resource Id #<something> Actual result: -------------- HELLO