Hi nmsinc,
CMSB doesn't have any support for anything like that. But here's two ways to get data from two tables with PHP and MySQL. They're both a little tricky but will hopefully point you in the right direction.
Using a MySQL join:
SELECT t1.fullname, t2.num
FROM cms_accounts t1
LEFT JOIN cms_accounts t2 ON t1.fullname = t2.fullname
Basically saying "join table1 with table2 when both fields match. Using your fieldnames it might look like this:
SELECT t1.employee_name, t2.employee_number
FROM {$TABLE_PREFIX}paysheet_hours t1
EFT JOIN {$TABLE_PREFIX}accounts t2 ON t1.employee_name = t2.employee_name
Or if you're working in PHP, another way is just to create a lockup array of employee names to nums:
$accounts = mysql_select('accounts');
$accountNames = array_pluck($accounts, 'employee_name');
$accountNums = array_pluck($accounts, 'employee_number');
$namesToNums = array_combine($accountNames, $accountNums);
print "Bob is account # " .@$namesToNums['Bob']. "<br/>\n";
print "And here's a list of all the names to nums:\n";
showme($namesToNums);
exit;
And if it's easy to do, it's generally better to associate records by number (num, or employee_number) instead of name, since they're less likely to change than names, labels, or titles.
Hope that helps, let me know any questions.
Dave Edis - Senior Developer
interactivetools.com