Hi, Please can someone help me with this. It is not returning any results but it should. SELECT * FROM listings WHERE (category = 'Weddings' or category2 = 'Weddings' or category3 = 'Weddings') AND (subcategory = 'DJs Discos and Karaoke' or subcategory2 = 'DJs Discos and Karaoke' or subcategory3 = 'DJs Discos and Karaoke') AND status = '1' ORDER BY ('premium', 'sdate') Code (markup): Cheers, Adam
Don't use single quotes in column name after order by clause because it will be considered as string instead of column name.it should be like this ORDER BY (premium, sdate)
Thanks for that, but that still does not return a result when it should. Is there anything else wrong with the statement?
Can u give the table structure , i mean it looks that status field is of integer type but you are giving 1 in single quotes
Maybe try without parenthesis: ORDER BY premium ASC, sdate ASC Switch ASC with DESC if you want a descending order.