[{"course_id":"BIO-399","title":"Computational Biology","dept_name":"Biology","credits":"3"},{"course_id":"CS-315","title":"Robotics","dept_name":"Comp. Sci.","credits":"3"},{"course_id":"CS-319","title":"Image Processing","dept_name":"Comp. Sci.","credits":"3"},{"course_id":"CS-347","title":"Database System Concepts","dept_name":"Comp. Sci.","credits":"3"},{"course_id":"EE-181","title":"Intro. to Digital Systems","dept_name":"Elec. Eng.","credits":"3"},{"course_id":"FIN-201","title":"Investment Banking","dept_name":"Finance","credits":"3"},{"course_id":"HIS-351","title":"World History","dept_name":"History","credits":"3"},{"course_id":"MU-199","title":"Music Video Production","dept_name":"Music","credits":"3"}] <?php

    $dbhandle 
= new PDO("sqlite:uni.db") or die("Failed to open DB");
    if (!
$dbhandle) die ($error);

    
$credits 3;
    if (isset(
$_GET["credits"])){
      
$credits $_GET["credits"];
    }
    
$query "select * from course where credits=".$credits;
    
$statement $dbhandle->prepare($query);
    
$statement->execute();
    
$results $statement->fetchAll(PDO::FETCH_ASSOC);

    echo 
json_encode($results);
    echo 
highlight_file(__FILE__true);
?>