I’ma take a stab at this, because I think we’re getting a little forest-for-the-trees here. I’ll stick it through Google Translate to try and eliminate the language barrier, but i’m not gonna guarantee any better translation than that Google Translate identifies your language as Afrikaans.
Please correct me where my understanding fails.
Korrigeer my asseblief waar my begrip misluk.
You want to take the query;
Jy wil die navraag neem;
SELECT DISTINCT created_at FROM cmc_my_munte GROUP BY created_at ORDER BY created_at DESC
And output a series of table rows, each containing 2 cells; the first cell contains the date. The second cell contains the date differential between that date and today.
En voer 'n reeks tabelrye uit, wat elk 2 selle bevat; die eerste sel bevat die datum. Die tweede sel bevat die datumverskil tussen daardie datum en vandag.
You currently have the following code:
Jy het tans die volgende kode:
<td style="color:#EFE1CE">
<?php
$date = $checkSqlRow["CREATED_AT"];
$newDate = date("Y M d", strtotime($date));
echo $newDate;
?>
</td>
<td>
<?php
$res = $pdo->query("SELECT DISTINCT created_at FROM cmc_my_munte GROUP BY created_at ORDER BY created_at DESC ");
$today = new DateTime('now');
foreach ($res as $row)
{
$dt = new DateTime($row['created_at']);
$diff = $dt->diff($today)->format("%y Jare -- %m Maande -- %d Dae");
echo "$diff <br>";
}
?>
</td>
I have a couple of questions about this, because you’re checking a value “$checkSqlRow”, that somehow has a value outside of your query. Is there some other query and loop that is being performed?
Ek het 'n paar vrae hieroor, want jy kontroleer 'n waarde “$checkSqlRow”, wat op een of ander manier 'n waarde buite jou navraag het. Is daar 'n ander navraag en lus wat uitgevoer word?
If you’ve already got a record from the first query, what is the field in the first query that links to the cmc_my_munte table?
As jy reeds 'n rekord van die eerste navraag gekry het, wat is die veld in die eerste navraag wat na die cmc_my_munte-tabel skakel?
If you do have a query and loop around this code, it may be beneficial to our understanding if you show us that too. The more of your code we can see, the better we can help you.
As jy wel 'n navraag het en 'n lus rondom hierdie kode het, kan dit voordelig wees vir ons begrip as jy dit ook vir ons wys. Hoe meer van jou kode ons kan sien, hoe beter kan ons jou help.