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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:11:16+00:00 2026-06-03T15:11:16+00:00

How can I update_option in WordPress from this: everything I do seems not to

  • 0

How can I update_option in WordPress from this:
everything I do seems not to work; I must be missing something simple.

$l1teams = array(
    1=>"Caterham-Renault",
    2=>"Ferrari",
    3=>"Force India-Mercedes",
    4=>"HRT-Cosworth",
    5=>"Lotus-Renault",
    6=>"Marussia-Cosworth",
    7=>"Mercedes GP",
    8=>"Mclaren-Mercedes",
    9=>"Red Bull-Renault",
    10=>"Sauber",
    11=>"Toro Rosso-Ferrari",
    12=>"Williams-Renault",
    );

<td><select name="league1_driver1_team"><?php foreach($l1teams as $team){?> <option value="<?php echo $l1d1t ?>"><?php echo $team ?></option> <?php } ?> </select></td>

I have all the other code setup correctly; I just cannot insert this value into the database in WordPress and echo it back out.

  • 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-03T15:11:17+00:00Added an answer on June 3, 2026 at 3:11 pm

    You are trying to echo $l1d1t in your option tag which seems to be undefined in your example. You probably want something want to change your code to something like this:

    <td><select name="league1_driver1_team"><?php foreach($l1teams as $team_id => $team_name){?> <option value="<?php echo $team_id; ?>"><?php echo $team_name; ?></option> <?php } ?> </select></td>
    

    Essentially what I am doing is setting the array index to $team_id and the array value to $team_name.

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

Sidebar

Related Questions

How can I update this regular expression to find and replace not just /news/
Hopefully someone can help me out with this. I am upgrading a widget from
I want to understand how I can update my GUI with a simple text
I can't update the rubygems from 1.3.1 to 1.3.5. I've tried the following commands
I'm using PHP to display the most recent tweet from a user. This is
I'm developping my first real big pluggin for wordpress and so far almost everything
This maybe a really simple question but for some reason my code isn't working.
The $bet_closing is set to this in the WordPress admin: November 9, 2011 6:59AM
How do I release an update for my app? I can not find an
Okay, for some reason this morning, I am unable to connect to the Wordpress

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.