Php json please help me urgent


#1
$db = new db();  $db = $db->connect(); $sqlproducts = "SELECT * FROM products ";
$resultproducts = $db->query($sqlproducts);
while($rowproducts = $resultproducts->fetchAll(PDO::FETCH_OBJ) ){
  echo '{"Products": ' . json_encode($rowproducts) .' }'; $sqlskus = "SELECT * FROM sku  ";
  $resultsku = $db->query($sqlskus); while($rowsku = $resultsku->fetchAll(PDO::FETCH_OBJ)){
    echo '{"Products": ' . json_encode($rowsku ) . '}'; } }

#2

the result give me just the data of the first select


#3

If you can use a JOIN to fetch data from another table.

Again, this has nothing to do with Slim.
You should first learn how to do common tasks with plain PHP before getting into a framework like Slim.
Just my two cents.