. **/ if(isset($_GET['getprojects'])){ $sql=$db->prepare("SELECT p.id, p.name, p.description, u.fullname AS owner, p.path, p.repo, p.status, p.image FROM projects AS p INNER JOIN users AS u ON (u.id=p.owner) ORDER BY p.name ASC"); $sql->execute(); $projects=array(); while($row=$sql->fetch(PDO::FETCH_ASSOC)){ array_push($projects, json_encode($row)); } echo json_encode($projects); die(); }