Greetings, there are 2 db_cashin, db_shop with the same fields:

mysql table

It is necessary to display in one request the information sorted in descending order by the time cell from both tables and take into account that steamid = '12345'

ZY I tried through UNION, but I can't sort it out ...

Here is my failed request:

 SELECT amount, tradeofferid, status, time FROM db_cashin WHERE steamid = '{$steamid}' UNION SELECT amount, tradeofferid, status, time FROM db_shop WHERE steamid = '{$steamid}' 

    1 answer 1

     select * from (ваш запрос) t order by `time` desc 
    • A warning pops up images.vfl.ru/ii/1463399078/133036a0/12681037.jpg and the worst thing is that no record from the database is displayed - Vladislav Siroshtan
    • You print errors. You have returned false on request - splash58
    • I did not understand you at the expense of "print errors" - Vladislav Siroshtan
    • $mysqli->errno after query - splash58
    • I forgot the list in (*) to put :) - splash58