I have a very simple mysql query, I want to fetch some ‘data’ from two tables table1 and table2 as soon as this ‘data’ is in one row containing a precise ‘id’, so I ran a prepared request :
'select data from (
select data from table1 union select data from table2)
where id = :id'
But it doesn’t seem to work (btw, I tried simply 'select data from table1, table2 where id = :id ')
but it didn’t work. Someone could help, I don’t know where I am missing something ?
1 Answer