sql - Problem in mysql when ordering by more than one column using ORDER BY FIELD -


I have a MySQL query where I sort by field:

  "..WHERE (pattern id id ($ id join)) $ where order by command ($ ids2) LIMIT 0, $ numlines";  

Where $ idsJoin2 is something like this:

  my $ idsJoin = join (',', @ id); My $ idsJoin2 = "patterns.id," Add $ id;  

And "IID is an array with numbers I want to order.

This is the thing that after ordering by $ idsJoin2, I have another Column, like this:

  "WHERE (pattern id id ($ IDs)) $ $ where ORDER BY FIELD ($ IDs2), products.product, versions.version, builds.build LIMIT 0, $ NumLines ";  

If I sort that column by them with any problem, but if they are after ORDER BY FIELD, which I want , It's just

I do not know why this is happening Thank you.

Why do you call ID in $ ids2 Adding? Is not it just 'patterns.id' If you want to order from that column?


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -