Thanks so much for your help so far. I took all your suggestions, turned on debugging in Joomla configuration and see the query outputs.
When I login to CB though, the query found within my plug-in's onAfterLogin function does not get displayed. I do know that it is working though because static information from my query is succesfully inputting into the database. Is there a way I can get queries from within that function to output in the debugging area?
Also, I created an additional column to hold the user id, one int and one varchar, and tried passing the same variable to both types of columns, and it shows up as 0 in both. I also removed the quotes and tried again, but only 0's.
[code:1]
global $database, $my;
$user_id = $my->id;
$querya="INSERT INTO #__comprofiler_plug_act SET userid=$user_id, new_id=$user_id";
$database->setquery($querya);
return $database->query();
[/code:1]
Is there any other reason why this wouldn't be working that you can think of?
I did some more testing and tried using the onAfterLogout function, and the same query worked to pass the $my->id value into the database table.
This leads me to believe that CB doesn't know what the user id is for the user who just logged in during the onAfterLogin function. How can I capture the user id during the login process or immediately after login?
The id for the user in onAfterLogin is $user->id, which is why there is a $user in the function params. The $user object includes all other cb fields, eg $user->cb_gender etc