Menu
Hello,
Table name: currencies
id —- currency
id: 1 => USD
id: 2 => EURO
id: 3 => TL
Table name: exchange
id —- from_unit (Table id “currency”) —- to_unit (Table id “currency”)
1 —- 1 —- 3
2 —- 2 —- 3
3 —- 2 —- 1
Print
USD => TL
EURO => TL
EURO => USD
“`
$exchange = $PDO->prepare(“SELECT
exchange.id,
exchange.from_unit,
exchange.to_unit
currencies.currency,
FROM exchange
INNER JOIN currencies ON exchange.from_unit = currencies.id
ORDER BY ID DESC”);
$exchange->execute();
while ($row = $exchange->fetch()) {
echo $row[‘currency’].”=>”.$row[‘to_unit’];
}
How can I show the “to_unit” field
Thank you from now