 <p>This works fine for me:</p> <pre><code>$q3='SELECT users.uid, users.vr, users.br, AES_DECRYPT(users.nm1,"123") AS nm1, AES_DECRYPT(users.nm2,"123") AS nm2, AES_DECRYPT(users.nm3,"123") AS nm3, ussys.ty1, ussys.ty3 FROM users,ussys WHERE users.uid=ussys.uid ORDER BY nm1 DESC '; </code></pre> <p>It sorts nicely on nm1, giving me Zack-Willeke-Victor-Roiwan-Plop-Kwab-Krab-Karel-Johannes-Harry-Gerard-Dirk-Cornelis-Bernard-Anton as a result.</p>