jeudi 2 avril 2015

How to fetch data in different arrays with PHP and SQLite?

I am trying to fetch data from different tables but is showing nothing in arrays. If I am going to comment one of the results is showing one of the arrays.



$result->setFetchMode(PDO::FETCH_ASSOC);
$items = $result->fetchAll();
$sql = "SELECT *
FROM 'types'
ORDER BY 'id'";

$result = $objDb->query($sql);
if (!$result) {
throw new PDOException("Error Processing Request");

}

$result->setFetchMode(PDO::FETCH_ASSOC);
$types = $result->fetchAll();
// $clients = $result->fetchAll();


Here is showing only the 'types' table. If I change FROM 'types' to FROM 'clients' and I will comment the $types = $result line will show the 'clients' table but I want to show both. How can I do this?


Aucun commentaire:

Enregistrer un commentaire