🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux in-mum-web1643.main-hosting.eu 5.14.0-687.46.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Sep 11 09:03:19 EDT 2026 x86_64
👤 User: u621169360 (621169360)
🐘 PHP: 8.2.33
🚫 Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail

💻 Terminal

📁 /home/u621169360/domains/agriexpertt.com/public_html
$

📄 get_question_medicines.php

📁 Path: /home/u621169360/domains/agriexpertt.com/public_html/mobile/Flutter/get_question_medicines.php
📊 Size: 1.1 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");

require_once 'db.php';

try {
    // Check if question_id is provided
    if (!isset($_GET['question_id'])) {
        throw new Exception("Question ID is required");
    }

    $questionId = $_GET['question_id'];

    // Fetch medicine details for the specific question
    $query = "SELECT id, medicine FROM questions WHERE id = :question_id";
    $stmt = $pdo->prepare($query);
    $stmt->bindParam(':question_id', $questionId, PDO::PARAM_INT);
    $stmt->execute();

    $result = $stmt->fetch(PDO::FETCH_ASSOC);

    if (!$result) {
        throw new Exception("No question found with the given ID");
    }

    // Parse the JSON medicine data
    $medicineData = json_decode($result['medicine'], true);

    // Return the medicine details
    echo json_encode([
        'status' => 'success',
        'question_id' => $result['id'],
        'medicines' => $medicineData ?? []
    ]);

} catch (Exception $e) {
    echo json_encode([
        'status' => 'error', 
        'message' => $e->getMessage()
    ]);
}
?>
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨