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;
	}

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.