0

AFTER a query for 1 category I receive details back. 1 category can have more items. The items have sequental id's but not in normal order.

While (category_items()) {
echo item_id(); // checking this give me for example id 1, 3 and 5.
}

I want to select one random item_id from these results.
Without adjusting the query itself.
Something like item_id() == 3 perhaps?
Is that possible?

Edited by diafol: duplicate thread

3
Contributors
9
Replies
21
Views
4 Years
Discussion Span
Last Post by mjsmitten
0

what exactly do you want to manipulate?Please be more descriptive so that we can help.

0

In the While (category_items()) { loop I echo item_id();
it give me 1 or more results. Example: 1, 3 and 4.
I want to pick one from those and say something like item_id() == 3.
Then when I echo item_id(); I would see "3".

0

btw: How do I get all results from this query visible to see what I can do with it?

osc_query_item(array('category' => osc_category_id(), 'page' => 0, 'results_per_page' => 3)) ;
0

@mjsmitten

You have not described your problem adequately. Also you're using custom functions, which we have no idea how they work. You don't show your query. What are you querying an array or a db??

0

Listen, I am kinda new to this site. How do I edit my first topic so I can put the code in there?

0

Well, if possible delete this topic, I already used another one with all the code inside. Thanks !

0

Well, if possible delete this topic, I already used another one with all the code inside. Thanks !

No not possible. Other contributors have made an effort to reply to you. You shouldn't start duplicate threads, that just ends up annoying members. If you supply the link here, we can then direct people to the other thread. Thanks.