prepare('SELECT name, email FROM clients WHERE id = :id'); $stmt->bindValue(':id', $selectedClientId, SQLITE3_INTEGER); // Execute the query $result = $stmt->execute(); // Fetch the data $row = $result->fetchArray(SQLITE3_ASSOC); // Return the data as JSON echo json_encode($row); // Close the database connection $db->close(); ?>