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.
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
the list.data isnt recognised and throws error Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, bool given
You need to provide a column alias
..., DATE(t.`data`) as `data`,...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With