can someone let me know what's wrong with this particular? It pops up empty when there's something there, what they are called within the fields are correct:

if($token = JRequest::getVar('token')){
$getImgQuery = 'SELECT adimage FROM #__chronoforms_data_adsList WHERE cf_uid = ' . $token;
$db->setQuery( $getImgQuery );
$imagename = $db->loadResult();
echo $imagename;
$fullimgpath = "adimages/" . $imagename;

I am by using this within an article, just beneath it I've more code that actually works:

$query = 'SELECT * FROM #__chronoforms_data_adsList WHERE cf_user_id = ' . $userid;
$db->setQuery( $query );
$result = $db->loadObjectList();

foreach ($result as $x){
//loop through everything including adimage

I have been attempting to decipher it for hrs however i can't appear to have it to operate, it's driving me nutz.

The only real reason i'm able to think about is your query examines to no rows whatsoever... Perhaps you have attempted printing it and running it in phpmyadmin to validate it DOES return something which there's no errors inside your SQL query that you're delivering?

if($token = JRequest::getVar('token')){

Presuming you need to set $token towards the variable came back by getVar (and $token does not contain a current value that you would like to check with ==), then I'd have a look another parameters taken by getVar and appearance it's coming back what you are expecting e.g. specify $hash and return $type.

To debug the query I'd add this line after loadResult()

print_r( $db );

Within the output, search for any error messages and run the converted _sql query by hand to determine the query works not surprisingly.