WHERE statement question

Filter K2 items for a dropdown list in ChronoForms.

Overview

The issue was an incorrect WHERE statement format in the DB Read action conditions.
Use the correct array syntax to specify multiple category IDs and the published status.

Answered
gl globerotter 15 Apr, 2015
Answer
Hi,

I'm building a simple Booking Request form and I want to populate a dropdown list with K2 Items (actually the 'title' of the item)

K2 items belong to various K2 categories so I use the DB Read action and in Conditions entered the code below:

<?php return array('published'=>'1', ":catid='32' OR catid='55' OR catid='71' OR catid='76'"); ?>

to fetch the K2 items from 3 categories and ONLY the "published" ones

But it doesn't work!!!

What am I doing wrong?
Max_admin Max_admin 15 Apr, 2015
1 Likes
You better use this:

<?php
return array('published' => '1', "catid" => array(32, 55, 71, 76));
?>


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
gl globerotter 15 Apr, 2015
Yes!!! It worked fine

Thanks for your fast answer
This topic is locked and no more replies can be posted.