Jump to content

Search the Community

Showing results for tags 'dynamic listbox'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi everyone, I'm a complete newbie here. I've looked around for help and tried a few solutions without success, so because time is short I'm asking for help. I have a registration form which includes address details. The form holds a country field which is a listbox, the values being selected from a MySQL table. How do I assign the selected country option to a field list in the insert statement? Here's what I have so far: Registration page form: <div class="form-group"> <input type="text" class="form-control" id="country" name="country" placeholder="Country"> <select name="country_list"> <?php $sql = mysql_query("SELECT country_name FROM countries"); while ($row = mysql_fetch_array($sql)){ echo "<option value=\"country_list\">" . $row['country_name'] . "</option>"; } ?> </select> </div> The insert function page: switch ($action) { case 'signup': switch ($action) { case 'signup': $country = clean($_POST['$selectedOption']); etc. The insert statement: $sql_insert = "INSERT INTO user_mst(country) VALUES('$country_name)"; $result_insert = mysql_query($sql_insert) or die(mysql_error()); $id = mysql_insert_id($conn); In the code sections above, I've removed some of the other fields etc. to focus on the one bit I don't know howto fix. Thanks in advance for any help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.