Forums

cc5 where statement

mduda 09 Jul, 2017
I've re-read the FAQ's on where statements. I've tried multiple ways to get data to show properly.

Using the below - the where properly captures the "published" and "auction" fields. but the fields with NOT LIKE still are displayed. Is there a different way I need to put this in CC5?

<?php
return array ( 'p.product_published ' => '1', 
'p.product_auction' => '0', 
'p.product_code NOT LIKE' => '%Watch%',
'p.product_code NOT LIKE' => '%PTA_Membership%', 
'p.product_code NOT LIKE' => '%Marquee%', 
'p.product_code NOT LIKE' => '%Donation%' ) ;
?>


Can't seem to do an "OR", so tried to create a string with "NOT LIKE" OR, and this doesn't work either.

<?php
$nonapparel = array ('Watch', 'Membership', 'Marquee', 'Bundle', 'Donation');

return array ( 'p.product_published ' => '1', 
'p.product_auction' => '0', 
'p.product_code NOT LIKE' => '%'.$nonapparel.'%'  ) ;

?>
GreyHead 10 Jul, 2017
Answer
Hi mduda,

I suggest that you use the 'colon :' syntax from the FAQ and spell out the query that you want to use in full.

Bob
mduda 10 Jul, 2017
That did the trick. Thanks Bob.
This topic is locked and no more replies can be posted.