title: Data value not recognised in query mysql
body: <p>I have this query that gets data from database first orders it by date then orders it by date and urgjenc_kod, but because i have added DATE(t.data) the date is not recognised this is the query.</p>
  <pre><code>SELECT list.* from(SELECT t.`id_ticket`,ts.`status_pershkrim`,DATE(t.`data`),
    t.`klient_emer`, t.`email`, t.`nr_tel`, nu.`urgjence_pershkrim`, 
    tp.`problematika_pershkrim`, t.`detaje`, t.`Stafi`,t.updated,u.emer as caktuar,
    t.status_id,t.urgjence_id,t.Stafi_krijues,t.urgjence_kod
  FROM ticket t
  LEFT JOIN  user u on u.id=t.drejtuar
  LEFT JOIN tipi_problematikes tp ON t.tipi_problematikes = tp.problematika_id
  LEFT JOIN nivel_urgjence nu on t.urgjence_id=nu.urgjence_id
  LEFT JOIN ticket_status ts on t.status_id=ts.status_id
  LEFT JOIN nivel_urgjence uk on t.urgjence_kod = uk.urgjence_kod
  Where vis=1
  ORDER BY t.data DESC LIMIT 100) as list order by list.data desc, list.urgjence_kod asc
  </code></pre>
  <p>the <strong>list.data</strong> isnt recognised and throws error <code>Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, bool given</code></p>