Title: multiple data input
Last modified: August 21, 2016

---

# multiple data input

 *  [571](https://wordpress.org/support/users/571-1/)
 * (@571-1)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/multiple-data-input/)
 *     ```
       <select name="list">
       <?php foreach ($data as $entry): ?>
   
       <option><?php echo $entry[1]; ?></option>
   
       <?php endforeach; ?>
       </select>
       ```
   
 * i’ve got this working in a drop down menu. only because there are multiple cell’s
   with the same name it is showing all same name several times.
 * Is there a way to only show the different values, and get all same values under
   1 value?
 * if someone have an example of a drop down, with few lines would also be great!
 * i’ve got this already; (it should go from the first list, to the second, third,
   forth… and then send this values together with the other values on the same row
   from excel to a page)
 *     ```
       <?php $data = wp_excel_cms_get("database"); ?>
   
       <form role="search" method="get" class="row search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
       	<div class="search-form">
   
       <select name="list1">
       <?php foreach ($data as $entry): ?>
   
       <option><?php echo $entry[0]; ?></option>
   
       <?php endforeach; ?>
       </select>
   
       <select name="list2">
       <?php foreach ($data as $entry): ?>
   
       <option><?php echo $entry[1]; ?></option>
   
       <?php endforeach; ?>
       </select>
   
       <select name="list3">
       <?php foreach ($data as $entry): ?>
   
       <option><?php echo $entry[2]; ?></option>
   
       <?php endforeach; ?>
       </select>
   
       <select name="list4">
       <?php foreach ($data as $entry): ?>
   
       <option><?php echo $entry[3]; ?></option>
   
       <?php endforeach; ?>
       </select>
   
       <select name="list5">
       <?php foreach ($data as $entry): ?>
   
       <option><?php echo $entry[4]; ?></option>
   
       <?php endforeach; ?>
       </select>
   
       <input type="submit" value="Go" onclick="ListSelectRedirect(''); return false;"/>
   
       </form>
       ```
   
 * [https://wordpress.org/plugins/wp-excel-cms/](https://wordpress.org/plugins/wp-excel-cms/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [webteilchen](https://wordpress.org/support/users/webteilchen/)
 * (@webteilchen)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/multiple-data-input/#post-4615033)
 * You could put every item in an array an then check if the item is in the array
   if yes: show it, else: skip it.
 *     ```
       <?php $shown = array(); ?>
       <select name="list">
       <?php foreach ($data as $entry): ?>
          <?php if(in_array($shown)): ?>
             <option><?php echo $entry[1]; ?></option>
             <?php $shown[] = $entry[1]; ?>
          <?php endif; ?>
       <?php endforeach; ?>
       </select>
       ```
   
 * I hope that helps.

Viewing 1 replies (of 1 total)

The topic ‘multiple data input’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-excel-cms_0069a0.svg)
 * [WP Excel CMS](https://wordpress.org/plugins/wp-excel-cms/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-excel-cms/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-excel-cms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-excel-cms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-excel-cms/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [webteilchen](https://wordpress.org/support/users/webteilchen/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/multiple-data-input/#post-4615033)
 * Status: not resolved