For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > August 2004 > DB_DataObject









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DB_DataObject
Tomek Klas

2004-08-25, 3:56 pm

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com