<?php

// $ids = $db->run("SELECT * FROM client_project WHERE clientId = ?", $user['client']['id']);
// foreach ( $ids as $id ) {
//     $projects[] = $db->row("SELECT * FROM project WHERE id = ?", $id['projectId']);
// }

$pdo          = $db->getPdo();
$stmt         = $pdo->prepare("SELECT project.id, project.title, project.sheetId, project.zip, project.city, project.createdBy, project.createdAt FROM project, client_project WHERE client_project.clientId = ? AND client_project.projectId = project.id ORDER BY createdAt DESC");
$exec         = $stmt->execute([$user['client']['id']]);
$userProjects = $stmt->fetchAll(\PDO::FETCH_ASSOC);


