Really struggling witth uisn g IN:\ in where conditions. I hav tried all I can think of
What is the correct syntax?
Stuck!
What is the correct syntax?
mdlMembers.cb_memberstatus/IN: '"Active","Life","Honorary"'or
mdlMembers.cb_memberstatus/IN: "'Active','Life','Honorary'"I have tried all of the variants I can think of including setting the string in {data:memberSelector}
Stuck!
model.field/in: ["one", "two", "three"]
What you've done is just asked it to look in a string.
What you've done is just asked it to look in a string.
Thanks - makes sense but
mdlMembers.cb_memberstatus/in: ["one", "two", "three"]leads to
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' [\"one\", \"two\", \"three\"]'' at line 1I tried escaping the " (\") and changed to ' but same effect.
Sorry needs to be an array. So you could use a custom code block before it with
["one", "two", "three"]And then using
model.field/in:{var.jsonde:custom_code_name}Passing it an array from PHP will work too without needing it to be jsondecoded first, or an array from your form data so field/in:{data:selected} if you had for example a checkboxes group called 'selected'.
Will try again tomorrow. I really must learn json but I think I understand the PHP approach.
Thanks again
Thanks again
UPDATE: You can create an array with a shortcode (if you really need to) and get it done like this
model.field/in:{value:["one", "two", "three"]}
model.field/in:{value:["one", "two", "three"]}
This topic is locked and no more replies can be posted.