Thanks for you reply Krileon.
The reason I used the code action is because I needed to call a select query to first get an id value, then I needed to call a "custom" function from an "included" file using that value.
After reading your post, I tried escaping my CB value using the quote and getEscaped functions below, but it didn't work for some reason, maybe I don't have the right syntax?
Code:
global $_CB_framework;
global $_CB_database;
require_once( $_CB_framework->getCfg( 'absolute_path' ). '/includes/my_functions.php');
//$fieldname = $_CB_database->quote([cb_myfieldname]); // doesn't work for some reason...
$fieldname = $_CB_database->getEscaped([cb_myfieldname]);
$query = "SELECT `id` FROM `#__database_table` WHERE `fieldname` = $fieldname ORDER BY `id` DESC LIMIT 1";
// get CB user info
$_CB_database->setQuery($query);
$neededID = $_CB_database->loadResult();
$test = custom_function($neededID); // then function performs necessary tasks
I can't seem to find the right function to use...let me know if there's an easier way
Thanks again,
V