Hmmm. Now that you mention it, I have ran into that in the past also...
Unfortunantly, that didnt seem to help in this case...
The error I get is:
Fatal error: Call to a member function on a non-object in /home/admin/public_html/conner/radius.php on line 51
The code that relates to this problem is:
Connect to the db:$conner_connection = NewADOConnection("mysql");
$conner_connection->PConnect($conner_host, $conner_user, $conner_pass, $conner_db) or die("Unable to connect!");
Skip over some non-important unrelated stuff
if ( empty($minorfunction) ) {
# Populate the Account Association array
$query = "SELECT id, CONCAT(name_last, ', ', name_first) from user_data ORDER BY name_last";
$result = $conner_connection->Execute($query) or die("Error in query: $query. " . $db->ErrorMsg());
while (!$result->EOF) {
$profile_ids[] = $result->fields[0];
$profile_names[] = $result->fields[1];
$result->MoveNext();
}
$smarty->assign('profile_ids', $profile_ids);
$smarty->assign('profile_names', $profile_names);
# Populate the RADIUS group array
$query2 = "SELECT DISTINCT GroupName from radgroupreply";
### The line right below this is the aformentioned line 51
$result2 = $conner_connection->Execute($query2) or die("Error in query: $query2. " . $db->ErrorMsg());
while (!$result2->EOF) {
$group_names[] = $result2->fields[0];
$result2->MoveNext();
}
$smarty->assign('group_names', $group_names);
# Display the page
$smarty->display('header.tpl');
$smarty->display('radius/add.tpl');
$smarty->display('footer.tpl');
} elseif ( $minorfunction == "submit" ) {
// blah blah
}
Since the line involved is trying to call the Execute method on the $conner_connection variable, and with the error message given, it leads me to believe that the DB connection is being closed, and therefore the $coner_connection variable destroyed...
The first query works fine. The second one fails...
Any thoughts?
Thanks,
Brad