How can i pass multiple parameter in module search?

JamBoy
JamBoy
@ashiksh
10 years ago
13 posts

As i am passing jrCore_list , i need to write a query with multiple parameters (example) profile_name="something" and profile_url="something".

Is there any solution?
updated by @ashiksh: 10/11/14 02:37:41AM
paul
@paul
10 years ago
4,326 posts
{jrCore_list module="jrProfile" search1="profile_name = something" search2="profile_url = something else" search3="xxxx = yyyy" . . . }
hth
Pa


--
Paul Asher - JR Developer and System Import Specialist
douglas
@douglas
10 years ago
2,790 posts
You can try something like this:

{jrCore_list search1="profile_name = something" search2="profile_url = something"}

https://www.jamroom.net/the-jamroom-network/documentation/development/89/jrcore-list


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
JamBoy
JamBoy
@ashiksh
10 years ago
13 posts
Sorry, I am asking you to write this in php , not in template
JamBoy
JamBoy
@ashiksh
10 years ago
13 posts
$profile_i = jrCore_db_table_name('jrProfile','item');
$profile_k = jrCore_db_table_name('jrProfile','item_key');

SELECT $profile_i ._item_id FROM profile_k k inner join $profile_i i ON i._item_id=k._item_id WHERE (k.key='profile_name' AND k.value='something')

Next i need to pass

(k.key='profile_url' AND k.value='something')


------------------

Is there any way to write it?
updated by @ashiksh: 09/10/14 08:23:56AM
michael
@michael
10 years ago
7,714 posts
There are many examples of it in the code datastore queries.

Here is one from the action module:
        //actions
        $_sp = array(
            'search'        => array(
                "_profile_id = {$params['profile_id']}"
            ),
            'skip_triggers' => true,
            'limit'         => 1000000
        );
        $_rt = jrCore_db_search_items('jrAction', $_sp);

If you could say what your trying to retrieve that would help answering the question.

From you query it looks like your trying to get a specific set of profile names.

        //profiles
        $_sp = array(
            'search'        => array(
                "profile_name = 'something'"
            ),
            'limit'         => 500
        );
        $_rt = jrCore_db_search_items('jrProfile', $_sp);

If you need multiple search strings then add to the array

        //profiles
        $_sp = array(
            'search'        => array(
                "profile_name = 'something'",
                "profile_xxxx = 'xxxxxxxxx'"
            ),
            'limit'         => 500
        );
        $_rt = jrCore_db_search_items('jrProfile', $_sp);

Tags