how to ad an "and" in my sort

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 18, 2009   (RSS)

By willydoit - July 17, 2009

Hi,

I am trying to produce three seperate sorts in a listing which I have managed to do, we have three different categories of listing a featured listing, a standard listing and a complimentary listing, I want to configure it so that featured listings do not also appear in the standard listing as well, my basic code is working and shows the lists correctly except that my code 'orderBy' => 'RAND()', 'where' => 'comp_listing = 0', )); also includes listings which have been tagged as featured (because they are not complimentary listings) thus showing them twice, I tried to amend the code to 'orderBy' => 'RAND()', 'where' => 'comp_listing = 0' and 'featured_listing = 0' , )); assuming it would then not include anyrthing which was a featured listing but that continued to show them twice, I could add another field to the listings so that each entry is either featured, standard or complimentary which would resolve the issue but that would mean amending all my listings so if I can simply amend the sort code that would be easier.

I am sure it is just a simple syntax issue.

Any help would be appreciated.



Thanks in advance

Re: [ross] how to ad an "and" in my sort

By willydoit - July 18, 2009

Hi Ross,

Thanks for your help. as we needed to get the site live I have just added a new field to the table so that each listing is either comp, standard or featured and presented three different lists which seems to have done the trick.



Thanks