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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:53:28+00:00 2026-06-11T18:53:28+00:00

I have a dropdown on my site which is static, but the value is

  • 0

I have a dropdown on my site which is static, but the value is different for each user. I’m wanting to have it so that it has a selected value based on the user level, but if I change my selection and press save it will update that value in the table. However every time It’s just setting the value to 0.

Select code so far:

<select id="user_level<?php echo $rrows['id']; ?>" name="user_level<?php echo $rlurows['id']; ?>">
    <option value="5"<?php if($rlurows['user_level'] == 5){ echo " selected=\"selected\"";} ?>>Admin</option>
    <option value="4"<?php if($rlurows['user_level'] == 4){ echo " selected=\"selected\"";} ?>>Staff</option>
    <option value="3"<?php if($rlurows['user_level'] == 3){ echo " selected=\"selected\"";} ?>>Lead</option>
    <option value="2"<?php if($rlurows['user_level'] == 2){ echo " selected=\"selected\"";} ?>>Guard</option>
    <option value="1"<?php if($rlurows['user_level'] == 1){ echo " selected=\"selected\"";} ?>>Camp</option>
    <option value="0"<?php if($rlurows['user_level'] == 0){ echo " selected=\"selected\"";} ?>>Guest</option>
</select>

On Save Code:

onclick='$.get("do.php",{ cmd: "edit", user_level:$("input#user_level<?php echo $rlurows['id']; ?>").val(),id: "<?php echo $rlurows['id']; ?>" } ,function(data){ $("#msg<?php echo $rlurows['id']; ?>").html(data); });'

Code retrieving in do.php:

$lvl = mysql_real_escape_string($_GET['user_level']);

Can anyone see the issue that is making my code not work? Do I need to post any more code?

EDIT:

Whoops. Must be tired. :). <select id="user_level<?php echo $rrows['id']; ?> should be <select id="user_level<?php echo $rlurows['id']; ?> and input#user_level should be select#user_level

  • 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-11T18:53:29+00:00Added an answer on June 11, 2026 at 6:53 pm

    <select id="user_level<?php echo $rrows['id']; ?> should be <select id="user_level<?php echo $rlurows['id']; ?> and input#user_level should be select#user_level

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

Sidebar

Related Questions

I have a site here (http://beta.ohsinsider.com/) which has a dropdown in the search bar
I have dropdown menu..which is dynamic.. How can get value of the last item
I've got a PHP-driven site that has a recordkeeping form. The user chooses a
I have a dropdown menu on my site that I want to use to
I have dropdown-Lists which have a lot of elements (>1000). When I select one
I have a dropdown menu that pulls in text from a database column. The
I have a dropdown menu that I am using and can't quite get it
I have several DropDown controls on a Web Form which are filled using AJAX
I inherited a site which I am in the middle of updating which has
Twitter Bootstrap http://twitter.github.com/bootstrap/javascript.html#dropdown has a dropdown.js library (at http://twitter.github.com/bootstrap/1.4.0/bootstrap-dropdown.js )that will change the dropdown

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.