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 680645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:23:44+00:00 2026-05-14T01:23:44+00:00

Ok so my admin sets to edit a book which was created. I know

  • 0

Ok so my admin sets to edit a book which was created. I know how to bring in the values that were initially entered via a simple text field like ‘bookname’. On the edit book page the book name field stores the currently assigned ‘bookname’ in the field (which is what I want! 🙂 )

However I have other field types like selects and radio button entries…I’m having trouble calling in the already set value when the book was created.

For example, there is a ‘booklevel’ field, which I have set as radio button entries as; Hard, Normal, and Easy. When the user goes to edit the book, I’m not too sure on how to have the current value drawn up (its stored as text) and the radio button being checked. I.e. ‘Normal’ is checked if this is what was set when the book was created. So far I have this as the code for the adding book level:

<label>Book Level:</label> <label for="booklevel1" class="radio">Hard
<input type="radio" name="booklevel" id="booklevel1" 
value="<?php echo 'Hard'; if (isset($_POST['booklevel'])); ?>"></label>

<label for="booklevel2" class="radio">Medium<input type="radio" name="booklevel"
id="booklevel2" 
value="<?php echo 'Normal'; if (isset($_POST['booklevel'])); ?>"></label>

<label for="booklevel" class="radio">Low<input type="radio" name="booklevel"
id="booklevel3" 
value="<?php echo 'Easy'; if (isset($_POST['booklevel'])); ?>"></label>

This all works fine by the way when the user adds the book… But does anyone know how in my update book form, I can draw the value of what level has been set, and have the box checked?? To draw up the values in the text fields, I’m simply using:

<?php echo $row['bookname']?>

I also noticed a small issue when I call up the values for my Select options. I have the drop down select field display the currently set user (to read the book!), however, the drop down menu again displays the user in the list available options to select – basically meaning 2 of the same names appear in the list! Is there a way to eliminate the value of the SELECTED option? So far my setup for this is like:

<select name="user_id" id="user_id">


        <option value="<?php echo $row['user_id']?>" SELECTED><?php echo $row['fullname']?></option>

         <?php  
     while($row = mysql_fetch_array($result))
  { ?>      <option value="<?php echo $row['user_id']?>"><?php echo $row['name']?></option>
        <?php } ?>

        </select>

If anyone can help me I’ll be very greatful. Sorry for the incredibly long question!! 🙂

  • 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-05-14T01:23:45+00:00Added an answer on May 14, 2026 at 1:23 am

    Check to see which string is stored in the DB (easy, normal, hard) and then set the checked field to ‘checked’. For example:

    <label>Book Level:</label> <label for="booklevel1" class="radio">Hard
    <input type="radio" name="booklevel" id="booklevel1" 
    value="hard" <?php if($row['booklevel'] == 'hard') echo 'checked="checked"'; ?>></label>
    

    As to the second part – you’ll need to store the first value of $row['user_id'] in a temporary variable before entering the while loop. Then check each additional user_id you receive to determine whether it is equal. If it is, don’t print its option. Like so:

    <?php
    
    $tmp = $row['user_id'];
    while($row = mysql_fetch_array($result)) {
        if($row['user_id'] != $tmp) {
            echo '<option value="'.$row['user_id'].'">'.$row['name'].'</option>';
        }
    }
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 545k
  • Answers 545k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • added an answer Well, start off by thinking of which bits of data… May 17, 2026 at 9:17 am
  • added an answer For this task it is a good idea to use… May 17, 2026 at 9:15 am
  • added an answer This is exactly how the Skyhook database (built into many… May 17, 2026 at 9:15 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Given an admin media class that sets up a rich text editor, like: class
http://admin:123456@192.168.1.178/videostream.cgi I didn't know that username and password could be set directly in the
I have an admin form that lets users create entities that require an image.
I have a Rails app that sets a cookie and does a redirect to
Django-admin is pluralizing a model that I have running as a proxy class. The
In the admin interface and newforms there is the brilliant helper of being able
In my admin view I would like several sub directories for example: admin/users/list.aspx I
I'm the IIS admin, not the developer on this site, so the code is
http://localhost:50034/Admin/Delete/723 Always needs this parameter to perform the action, however, if you go to
In the admin section of a website i am building i would like to

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.