ID: 38709 Updated by: [EMAIL PROTECTED] Reported By: akbara13 at gmail dot com -Status: Open +Status: Bogus Bug Type: MySQL related Operating System: Debian GNU/Linux Etch PHP Version: 5.1.6 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2006-09-04 10:32:48] akbara13 at gmail dot com Description: ------------ When defining some variables into a constructor, these ones are not "seen" when calling mysql-functions. For instance: __construct () { $db_host = "localhost"; $db_user = "akbara"; $db_pass = ""; } public function db_routine () { mysql_connect ($db_host, $db_user, $db_pass) or die (mysql_error()); } -------------- The error message is: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'www-data'@'localhost' (using password: NO) in /home/akbara/server/localhost/www/fa.php on line 33 Access denied for user 'www-data'@'localhost' (using password: NO) --------------- Defining the variables within the function db_routine () doesn't causes such an error. The workaround of this problem: using $this->var when defining the var within __construct () and then into mysql_function ($this->var). This is usually processed correctly. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38709&edit=1