WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

MYSQL Double Sorting

DandeNada

New member

0

0%

Status

Offline

Posts

54

Likes

0

Rep

0

Bits

281

3

Months of Service

0%
Hello friends, think of a messaging system where when a message is pinned like in WhatsApp, I want the message to be pinned to the top, but if there are multiple pinned messages, I want the most recently pinned one to be at the top among them. The query seems correct to me, but for some reason, it's not being sorted correctly. The structure of the sorting will prioritize pinned messages (ozel_mesaj = 1) to be at the top and then non-pinned messages (ozel_mesaj = 0) to be sorted among themselves. In short, it will be like WhatsApp. The system is complete, but only the SQL code is pulling incorrectly. The above code should be correct according to the logic, but it's not working as expected no matter what I try. I've been trying different ways to revise the query for hours now, but it's not working. Does anyone have any ideas?
 

249

6,622

6,642

Top