DB Get JR ProfileURL from UserID
Jamroom Developers
I'd avoid trying to use SQL on a datastore if at all possible. If possible use the jrCore_db_query() function to get datastore stuff or you're bypassing all the other modules optional overrides.
A search query to get all profiles info would be
$_rt = array(
'search' => array(
'profile_url in ' . implode(',', $_tmp)
),
'return_keys' => array('_profile_id', 'profile_url'),
'skip_triggers' => true,
'ignore_pending' => true,
'limit' => count($_tmp)
);
$_rt = jrCore_db_search_items('jrProfile', $_rt);
if ($_rt && is_array($_rt) && isset($_rt['_items'])) {
.....
do a search on the codebase for '
jrCore_db_search_items('jrProfile',' and you'll see many examples.
A profile url in is just the base url of the site + the profile_url, so in php that's
$profile_url = "{$_conf['jrCore_base_url']}/{$item['profile_url']}";
if you absolutely have to do a direct SQL query then its
$tbl = jrCore_db_table_name('jrProfile', 'item_key');
$req = "SELECT * FROM {$tbl} WHERE item_id = '1' ";
$single = jrCore_db_query($req, 'SINGLE');
$_many = jrCore_db_query($req, 'NUMERIC');