Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9154643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:27:36+00:00 2026-06-17T12:27:36+00:00

I have an application you can view here to test APPLICATION, but I am

  • 0

I have an application you can view here to test APPLICATION, but I am having to little issues I can’t seem to figure out.

  1. Even though the queries are correct it is not able to display the module selected in code below:

       <p>
        <strong>Selected Module:</strong><?php $dbModuleNo;?> - <?php$dbModuleName;?> <input type='hidden' value='<?php$_POST["module"];?>'>
        </p>
    
  2. How can I display Please Select Module and Please Select an Assessment messages only after the user has selected a Please Select option from one of the relevant drop down menus and submitting it:

Code is below (I commented out queries):

<form action="" method="post"> 
                <?php            
                /*
                $moduleactive = 1;
                $sql = "SELECT ModuleId, ModuleNo, ModuleName FROM Module WHERE ModuleActive = ? ORDER BY ModuleNo"; 

                $sqlstmt=$mysqli->prepare($sql);
                $sqlstmt->bind_param("i", $moduleactive);
                $sqlstmt->execute(); 
                $sqlstmt->bind_result($dbModuleId,$dbModuleNo,$dbModuleName);
                $sqlstmt->store_result();
                $sqlnum = $sqlstmt->num_rows();
                */
                ?>
                Module: 
                <select name="module" id="modulesDrop">
                    <option value="">Please Select</option>
                    <?php
                    while($sqlstmt->fetch()) { 
                        $ov = $dbModuleNo . "_" . $dbModuleName . "_" . $dbModuleId; 
                        if($ov == $_POST["module"]) 
                            echo "<option selected='true' value='$ov'>$dbModuleNo - $dbModuleName</option>" . PHP_EOL; 
                        else 
                            echo "<option value='$ov'>$dbModuleNo - $dbModuleName</option>" . PHP_EOL;
                     } 
                    ?>
                </select>
                <input id="moduleSubmit" type="submit" value="Submit Module" name="moduleSubmit" />
            </form>
    <?php if(isset($_POST["module"]) && $_POST["module"] != "") { ?>
            <form action="" method="post"> 
                <p>
                <strong>Selected Module:</strong><?php $dbModuleNo;?> - <?php$dbModuleName;?> <input type='hidden' value='<?php$_POST["module"];?>'>
                </p>
                Asessments: 
                <?php
                /*
                $sessionquery = "
                    SELECT s.SessionId, SessionName, SessionDate, SessionTime, ModuleId, SessionActive, Complete
                    FROM Session s
                    INNER JOIN Session_Complete sc ON sc.SessionId = s.SessionId
                    WHERE
                    (ModuleId = ? AND SessionActive = ? AND Complete = ?)
                    ORDER BY SessionName 
                    ";
                $active = 1;
                $complete = 1;
                $sessionqrystmt=$mysqli->prepare($sessionquery);
                // You only need to call bind_param once
                $sessionqrystmt->bind_param("iii",$moduleId, $active, $complete);
                // get result and assign variables (prefix with db)
                $sessionqrystmt->execute(); 
                $sessionqrystmt->bind_result($dbSessionId,$dbSessionName,$dbSessionDate,$dbSessionTime, $dbModuleId, $dbSessionActive, $dbComplete);
                $sessionqrystmt->store_result();
                $sessionnum = $sessionqrystmt->num_rows();        
                */

            if ($sessionnum == 0 ){    ?>
                <span class='red'>Sorry, You have No Assessments under this Module</span>
            <?php } else { ?>
                <select name="session" id="sessionsDrop">
                    <option value="">Please Select</option>
                    <?php
                        while ( $sessionqrystmt->fetch() ) {
                            $sv = $dbSessionId;
                            if($sv == $_POST["session"]) 
                                echo "<option selected='true' value='$sv'>$dbSessionName - date('d-m-Y',strtotime($dbSessionDate)) - date('H:i',strtotime($dbSessionTime))</option>" . PHP_EOL;
                            else
                                echo "<option value='$sv'>$dbSessionName - date('d-m-Y',strtotime($dbSessionDate)) - date('H:i',strtotime($dbSessionTime))</option>" . PHP_EOL;
                        }
                    ?>
                </select>
                <br>
                <input type="submit" value="Submit Assigments">
            </form>
            <br>
            <br>
            <?php
    if(isset($_POST["session"]) && $_POST["session"] != "")    {

    /*
            $sessiondetailsquery = "
                SELECT s.SessionId, SessionName, SessionDate, SessionTime, SessionDuration, SessionWeight, TotalMarks, 
                s.ModuleId, ModuleNo, ModuleName, s.Room, Building, Capacity, SessionActive, Complete, PenaltyEnabled, COUNT(PenaltyMarks)
                FROM Module m
                INNER JOIN Session s ON m.ModuleId = s.ModuleId
                INNER JOIN Session_Complete sc ON sc.SessionId = s.SessionId
                LEFT JOIN Room r ON s.Room = r.Room
                LEFT JOIN Penalty p ON s.SessionId = p.SessionId
                LEFT JOIN Penalty_Marks pm ON s.SessionId = pm.SessionId
                WHERE
                (s.SessionId = ?)";
            $active = 1;
            $complete = 1;
            $sessiondetailsqrystmt=$mysqli->prepare($sessiondetailsquery);
            // You only need to call bind_param once
            $sessiondetailsqrystmt->bind_param("i",$dbSessionId);
            // get result and assign variables (prefix with db)
            $sessiondetailsqrystmt->execute(); 
            $sessiondetailsqrystmt->bind_result($detailsSessionId,$detailsSessionName,$detailsSessionDate,$detailsSessionTime, $detailsSessionDuration, $detailsSessionWeight, 
            $detailsTotalMarks, $detailsModuleId, $detailsModuleNo, $detailsModuleName, $detailsRoom, $detailsBuilding, $dbCapacity, $detailsSessionActive, $detailsComplete, 
            $dbPenaltyEnabled, $dbCountPenalyMarks);?>
            */
            <h3>CHOSEN ASSESSMENT</h3>
            <input type='text' id='currentId' name='Idcurrent' readonly='readonly' value='$detailsSessionId' /></td> 
            <br>
            <strong>Assessment:</strong> <?php $detailsSessionName; ?>
    <?php } else { ?>
            <p><strong class='red'>Please Select an Assessment</strong></p>
    <?php } } } else { ?>
            <p><strong class='red'>Please Select a Module</strong></p>
    <?php } ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:27:37+00:00Added an answer on June 17, 2026 at 12:27 pm
    <strong>Selected Module:</strong> - <?php$dbModuleName;?> <input type='hidden' value='<?php$_POST["module"];?>'>
    

    This is your error. If you view source you ll see that PHP code is being printed as it is because you are not spacing it properly. Try this

    <strong>Selected Module:</strong> - <?php echo $dbModuleName;?> <input type='hidden' value='<?php echo $_POST["module"];?>'>
    

    <?php$dbModuleName;?> should be <?php echo $dbModuleName;?>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't figure out what am I doing wrong here, I have there are
I am focused on the wrong layer of abstraction here, but can't figure out
I have an view-based application where the user can do a lot of customization
I have two view controller classes in my application delegate. I can change from
I have an application in which i am having a table view.when pressing a
I have a simple test application that I am having problems with. the UI
maybe you can help me out here. I have an issue with my codeigniter
We're developing a data heavy modular web application stack with java but have little
I have an application that can filter a datagridview based on date using a
I have an application that can be viewed with landscape and portrait mode. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.