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

  • Home
  • SEARCH
  • 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 8477857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:34:59+00:00 2026-06-10T18:34:59+00:00

Hello having a bit of problem retrieving a value so i might use it.

  • 0

Hello having a bit of problem retrieving a value so i might use it.
This is is where i should get my value.

<input type="text" class="typed" readonly="readonly" name="levele"
    value="<?php
    if($get_display->level== "Grade 2") {
        echo "Grade 4"; $lbl="Grade 4";
    }?>">

For a simple test i will use the value Grade 4 because i know what the outcome I’m suppose to have. This is the code that i want to retrieve the value of “levele” so it may perform a SQL statement. For example i have 5 sections that are for grade 4 so i was thinking on using this sql statement.

<select name="section_id">
    <option>SECTIONS</option>
    <?php 
        $result = mysql_query("SELECT * FROM tbl_section where level='".$_GET['levele']."'");
        while($row = mysql_fetch_array($result))
        {
            echo '<option value='.$row['section_id'].'>' .$row['section_name']. '</option>';
        }
    ?>  
</select>

So far i am unable to retrieve “levele” so it may be used it the sql, also tried $_POST and $_request but nothing and i check if levele does have the value Grade 4 and it does also in my database. Would appreciate any help on this. Because after i have retrieve the 5 sections I will try to automatically select one section where for example if the student has a grade of 90 the section should be “A” I’m going to do it with if else. so i would appreciate any help to solve these problems.

  • 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-10T18:35:01+00:00Added an answer on June 10, 2026 at 6:35 pm

    I see three main problems here that I think you should address:

    Firstly, in your code at the top:

    <input type="text" class="typed" readonly="readonly" name="levele" value="<?php if( 
         $get_display->level== "Grade 2"){ echo "Grade 4"; $lbl="Grade 4";}?>">
    

    Your code will only echo and set a value if $get_display->level is equal to 2. Did you mean to add in an else statement as well in case the value is something other than Grade 2 perhaps?

    <?php 
        if($get_display->level== "Grade 2")
        { 
            echo "Grade 2"; $lbl="Grade 2";
        }
        else
        {
            echo "Grade 4"; $lbl="Grade 4";
        }
    ?>
    <input type="text" class="typed" readonly="readonly" name="levele" value="<?php echo $lbl; ?>">
    

    Secondly, your form section of code seems to be missing quotes around the values:

    echo '<option value='.$row['section_id'].'>' .$row['section_name']. '</option>';
    

    I think you meant to use this:

    echo '<option value="'.$row['section_id'].'">' .$row['section_name']. '</option>';
    

    Lastly, your code is very vulnerable to injection attacks. You really should look at moving to PDO and prepared statements when dealing with form data.

    Edit: This is just an afterthought, but I can’t see anywhere that you set $result to a valid connection, but I assume that this is somewhere else in your code.

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

Sidebar

Related Questions

Hello I'm having an issue with this check box : <input type=checkbox id=hideTempSeries checked=checked
Hello im having a bit of a problem, look at this: SELECT id, activate_key
Hello ladies and gents, I'm having a bit of problem with accept() . I
hello fellow java developers. I'm having a bit of an issue here. I have
Hello i am having a problem with resuming a thread my code is public
Hello I'm having trouble with the following piece of code: <h:selectOneMenu id=selectTipoAutorizacion value=#{autorizacion.codigoTipoAutorizacion} required=true>
hello I am having problem related to https:// . I have used FB.getLoginStatus(function(response) function
Hello I am having a hard time making this UI element look the way
Hello I am having a problem with the numbering of figures using Latex, I
Hello i am having trouble with passing a php return value to the innerHTML

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.