Jump to content

Retrieve cirtain values from akey and value query


antonyfal

Recommended Posts

Hi,

Im battling here to get "only" certain values from a "akey" and "value" query..

 

I have a list of items around 200 id's strong, i only want to pull cirtain values from the list,

the table structure is like so:

id, akey, value

 

// i don't know the values of the specific akey's or their id's but i do know the akey value.

what i am trying to do is only pull the values that are in the "getConfigTitle's" list below (this list is only a sample the actual list is around 100 strong)

here is my code sample:

 


	$query="SELECT akey,value FROM settings WHERE LOWER(akey) LIKE getConfigTitles();";
	$settingsList=doSelectSql($query);
	foreach ($settingsList as $set)
		{
		$r=array();
			$r['CONFIGTITLE']=getConfigTitles();
			$r['KEY'] = $set->akey;
			$r['SETTING'] = $set->value;
			$rows[]=$r;
		}

function getConfigTitles()
	{
	$titles=array();
	$titles['search']= "search" ;
	$titles['viewprofile']= "viewprofile" ;
	$titles['editprofile']= "editprofile" ;
	$titles['dashboard']= "dashboard" ;
	$titles['preview']= "preview" ;
	return $titles;
	}

Thanks for the reply.

is it that simple?? im going to give it a go.. i was hoping i could use the already made function somehow as there are 100+ specifics i need to get, i wanted to avoid all that writing AGAIN!.. i also have other queries like this one.. :(

 

In the meantime i will try it this way..

thanks

xyph

agg this is working perfectly xyph. It wasn't as hard to create the list as i thought, a little CTRL+H magic and all was 2 minutes worth :D..

 

I do like the page you sent me though... lots of interesting stuff there..

Thanks again

Best regards

Antony..

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.