setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Get the project ID from the URL parameter $project_id = $_GET['id']; // SQL query to fetch projects and their associated images $sql = "SELECT p.id AS project_id, p.title AS project_title, p.summary AS project_summary, p.details AS project_details, p.category AS project_category, p.tags AS project_tags, pi.id AS image_id, pi.image_path AS image_path FROM projects p LEFT JOIN project_images pi ON p.id = pi.project_id AND (pi.deleted IS NULL OR pi.deleted != 1) WHERE p.id = :project_id"; // Prepare and execute the query $stmt = $file_db->prepare($sql); $stmt->bindParam(':project_id', $project_id, PDO::PARAM_INT); $stmt->execute(); // Fetch the results $project = $stmt->fetchAll(PDO::FETCH_ASSOC); if (empty($project)) { die('Sorry, project not found!'); } } catch (PDOException $e) { // If an error occurs, print it // echo $e->getMessage(); } ?>
Eiz A.
Senior Moodle developer
Freelancer/Contractor
  • Main Location:
    UK, Leicester
  • Other Location:
    EU, Slovenia
Availability/Capacity

Skills

Moodle
PHP
HTML
CSS
JS/JQuery
MySQL
Git
Other skills:
  • API
  • Server setup & config
  • Apache
  • AWS
  • Jira
  • ...etc

Moodle plugin

Project details

Description
  • Project Type:
  • :

Ready to order your project?

Let's work together!
Contact me
brand
brand
brand
brand

BaraSoft