DB_DataObject
| From: | Tomek Klas | Date: | Wed, 25 Aug 2004 16:41:48 +0000 |
| Subject: | DB_DataObject | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14289@lists.php.net to get a copy of this message | ||
Hello,
I am doing a registration system using DataObject and HTML_QuickForm.
It's a bit strange, but all of the sudden, my custom rule stopped working.
To be precise, the DataObject inside throws out a message: DB_DataObject Error: No database name / dsn found anywhere
Offending script:
function username_exists($element_name, $element_value) {
$check_username = new DataObject_Protocols_users;
$check_username->username=$element_value;
$num_results = $check_username->find();
if ($num_results == 0) {
return true;
}
else {
return false;
}
}
It works just fine once I take the script out of function....
So, what is it, I am missing here?
Tomek