Results 1 to 1 of 1

Thread: Saving in Database a list box multiple values

  1. #1
    Thread Starter
    Expired Customer danieluandrei's Avatar
    Join Date
    Feb 2013
    Location
    Romania
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Saving in Database a list box multiple values

    Hello everyone.

    In the post a job form (submit-job-form.php), we introduced a scrolling list field with multiple choice type.
    Code:
    <p><label for="sector"><?php _e('Sector', APP_TD); ?> <span title="required">*</span></label> <select name="sector[]" id="sector" multiple="multiple">
      <option value="Sector1">Sector1</option>
      <option value="Sector2">Sector2</option>
      <option value="Sector3">Sector3</option>
      <option value="Sector4">Sector4</option>
      <option value="Sector5">Sector5</option>
      </select></p>
    OK. For preview (preview-job-form.php) I found a solution:
    Code:
    <?php foreach ($_POST['sector'] as $s)
    	{
    		echo '&rarr;'; echo $s;  echo '<br/>';
    	}
    ?>
    Now, in the (confirm-job-process.php) what is the code to write to save the values ​​in the database (table wp_postmeta)?

    Thanks in advance.

    Daniel.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Custom Values in Email for new list submissions
    By amodioe in forum ClassiPress General Discussion
    Replies: 2
    Last Post: June 3rd, 2011, 02:28 AM
  2. [MOD NEEDED] Saving longitude and latitude values.
    By johnster in forum ClassiPress General Discussion
    Replies: 1
    Last Post: August 11th, 2010, 07:44 AM
  3. Saving multiple checkboxes output as Array
    By vienna in forum ClassiPress General Discussion
    Replies: 0
    Last Post: July 16th, 2010, 12:06 PM
  4. Saving Customized Theme for multiple uploads
    By joshthomas80 in forum ClassiPress General Discussion
    Replies: 6
    Last Post: July 13th, 2009, 04:24 PM