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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:42:45+00:00 2026-05-29T09:42:45+00:00

I am having trouble figuring out how to implement this. I am returning user

  • 0

I am having trouble figuring out how to implement this. I am returning user data to populate a profile page where the user can edit information. It fills in fields like name, job, title, etc. I have a field called Interests where I grab the Main Interests before I execute the code returning the user data. So I store those in an array and then return them to populate the first one. But the second is dependent on which choice they make. How should I go about filling that second box (I know the code that I will use I asking about how I should store the data to be retrieved. Because I cant execute a sql command inside the while loop, and I dont really want to return every sub-interest that just seems like a waste of resources)

Code for returning user data:

$result = mysql_query("SELECT * FROM WHERE U.uid = '$uid';");
    while($row = mysql_fetch_assoc($result)){

Code for Adding Interests:

    <option selected value="">Select an Interest</option>
    <?
for ($i=0; $i<$setintcount; $i++)
{
      if($setinterests[$i] == $interests[$i])
      {
          echo "<option selected value='$setinterests[$i]'>$setinterests[$i]</option>";
      }
      else
      {
          echo "<option value='$setinterests[$i]'>$setinterests[$i]</option>";
      }
}
?>
  </select>
  Sub-Interest:   <select name="selectedsubint" id="selectedsubint" onchange="checkval(id);">
    <option selected value="">Select an Sub-Interest</option>
  </select>
  • 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-29T09:42:46+00:00Added an answer on May 29, 2026 at 9:42 am

    The easiest way is load all sub-interests, but you wrote its waste of resources. It depends on how much sub-interest you will have stored.
    Another solution is to refresh page and get needed sub-interests, but it seems rough to me.

    Elegant solution could be by using AJAX to get sub-interest. Throu AJAX you could call page that will generate right sub-interests for selected main-interest.

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

Sidebar

Related Questions

I'm having some conceptual trouble on figuring out how to best implement this... I
This seems possible, but I'm having a little trouble figuring out how to implement
I'm having trouble figuring out the solution to this SQL query. Schema Edit :
I'm having trouble figuring out how to create a foreign key constraint. My data
I'm having trouble figuring out how to exclude /public/bin from this rewrite rule RewriteCond
I having trouble figuring out the correct architecture for this kind of application: it's
Perhaps I'm just having trouble figuring out the callbackyness, but I can't figure out
I'm having trouble figuring out the proper way to update nested data using Google
I'm having trouble figuring out if/how I can an internal webserver setup for testing
I'm having trouble figuring out how to correctly reference the 'right' 'this' in a

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.