Home » Database » DB » Bug #6679
when object is defined connection to DB gives error
Details
| Submitted | 2006-02-03 08:43 UTC |
|---|---|
| From | edward at confirmat dot nl |
| Assigned | danielc |
| Status | Wont fix |
| Package | DB |
| PHP Version | 4.4.2 |
| OS | linux |
| Roadmaps | (Not assigned) |
Comments
[2006-02-03 08:43 UTC] edward at confirmat dot nl
Description:
------------
When $this->something is defined then call to DB::connect yields errors.
Has to do with $this being protected. Any other variable yields no errors.
Test script:
---------------
This program yield the errors:
<?php
require_once ('DB.php');
$this->a=3;
$loginquery = "SELECT user_ID FROM users WHERE user_name='blablabla'";
$hostname = "localhost";
$database = "database";
$username = "username";
$password = "password";
$dbasetype = "database";
$dsn = "$dbasetype://$username:$password@$hostname/$database";
$connection =& DB::connect($dsn);
/**
*
<br />
<b>Warning</b>: Problem with method call - please report this bug in <b>/srv/www/htdocs/login/examples/database_error.php</b> on line <b>16</b><br />
<br />
<b>Warning</b>: Problem with method call - please report this bug in <b>/usr/share/php/DB.php</b> on line <b>520</b><br />
<br />
<b>Warning</b>: Problem with method call - please report this bug in <b>/usr/share/php/DB.php</b> on line <b>557</b><br />
*/
?>
Expected result:
----------------
no error-messages. The potential bad use of $this has nothing to do with DB.
Anyway the $this->a gets defined just fine (as a StdClass) and is usable, so I would expect other functions to be able to deal with that.
Actual result:
--------------
<br />
<b>Warning</b>: Problem with method call - please report this bug in <b>/srv/www/htdocs/login/examples/database_error.php</b> on line <b>16</b><br />
<br />
<b>Warning</b>: Problem with method call - please report this bug in <b>/usr/share/php/DB.php</b> on line <b>520</b><br />
<br />
<b>Warning</b>: Problem with method call - please report this bug in <b>/usr/share/php/DB.php</b> on line <b>557</b><br />