            %%[[if preview]]%%
            <span>preview</span>
        %%[[endif]]%%
%%[[if publish]]%%
    <?php
        //passing record id in url
        if(isset($_GET['cid'])) {
            $myid = $_GET['cid'];
            } else {
                    echo    $myid = '**URL pram FAIL**/';
                    }
                    require '%relativeSiteAssetPath%/sc_assets/Database.php';
                    require '%relativeSiteAssetPath%/sc_assets/Post.php';
                    // Instantiate DB & connect
                     $database = new Database();
                     $db = $database->connect();

                     // Instantiate post object
                     $post = new Post($db);
                      $query = "SELECT * FROM  `events2` WHERE `id` =  ' $myid' ";

                    $stmt = $db->prepare($query);

                            $stmt->execute();
                                $fetch = $stmt->fetch();
        ?>
%%[[endif]]%%
