please i need to query 2 tables at once and display the content in table. here is the code:
<?php
include 'database.php';
$pdo = Database::connect();
$sql = 'SELECT producs.*,validation_superviseur.* FROM products ORDER BY product_id DESC ,validation_superviseur ORDER BY id DESC';
foreach ($pdo->query($sql) as $row) {
echo '<tr>';
echo '<td>'. $row['cat_id'] . '</td>';//this is retrieved from TABLE products
echo '<td><a href="details.php?brand_id='. $row['brand_id']. '">'. $row['brand_id']. '</a></td>';// this is retrieved from TABLE products
echo '<td>'. $row['product_title'] . '</td>';//this is retrieved from TABLE products
echo '<td>'. $row['product_img1'] . '</td>';// this is retrieved from TABLE products
echo '<td>'. $row['reaction'] . '</td>'; // this is retrieved from TABLE validation_superviseur
echo '</tr>';
}
Database::disconnect();
?>