I asked stackoverflow but so far no one responded :(
So I am trying to echo the 10 newest data from 2 different tables. Ive tried
did that about 10 times with offsets increasing by 1 then added them to arrays then did like a 100 if statements checking whcih one is newer but ive tried for hours doing that and I couldn't get it to work. Is there an easier way of doing this without making 100-200 if statements?
So I am trying to echo the 10 newest data from 2 different tables. Ive tried
Code
$stmt60 = $db->prepare("SELECT * FROM 54x2 ORDER BY date_time DESC LIMIT 5");
$stmt60->execute();
$stmt61 = $db->prepare("SELECT * FROM dd ORDER BY date_time DESC LIMIT 5");
$stmt61->execute();
$row60 = $stmt60->fetch();
$row61 = $stmt61->fetch();
$var = array($row60['date_time'], $row62['date_time'], $row64['date_time'], $row66['date_time'], $row68['date_time'], $row70['date_time'], $row72['date_time'], $row74['date_time'], $row76['date_time'], $row78['date_time']);
$var7 = array($row61['date_time'], $row63['date_time'], $row65['date_time'], $row67['date_time'], $row69['date_time'], $row71['date_time'], $row73['date_time'], $row75['date_time'], $row77['date_time'], $row79['date_time']);did that about 10 times with offsets increasing by 1 then added them to arrays then did like a 100 if statements checking whcih one is newer but ive tried for hours doing that and I couldn't get it to work. Is there an easier way of doing this without making 100-200 if statements?


![[Image: 4tAQ4Gf.png]](https://i.imgur.com/4tAQ4Gf.png)


![[Image: vibesignature.gif]](https://i.ibb.co/8LvxwtYQ/vibesignature.gif)