php - mysql select data from two tables and different structure -
hi there i'm building kind of agenda/website php/mysql. agenda has public events , users' personal notes ordered date. need load events events table in database , notes notes table. 2 tables have different structure , have 1 same field: datetime.
how can sort date public events , personal notes then?
please me out! =) luca
improving don's answer per op comments, can add column know table row in.
select 'events' tbl, datetime, location, organizer, null notes events union select 'user_notes' tbl, datetime, null, null, notes user_notes order datetime desc
Comments
Post a Comment