php - Fetch comma separated values in correspondent checkbox -


i working on property web site. want enter specifications of house or apartment. want fetch data 1 database field.

please check example picture: http://i.stack.imgur.com/7xbei.jpg

if value see in cafe,yp online both see in cafe & yp online check boxes must checked. example form, have more 100 checkboxes. not want make 100 fileds checkboxes.

looking forward reply.

do want right database entry based on checkboxes selected, or automatically highlight checkboxes in database well?

<?php     /*     *   assuming mysqli initialized $mysqli     *   assuming <input type="checkbox" name="checkbox[]" />     */      $found = array();      foreach($_post['checkbox'] $checkbox) {         if(!$s = $mysqli->query("select `id`, `value` `table` `value` '%$checkbox%'")) {             // no result         } else {             $result = $s->fetch_assoc();             $found[$result['id']] = $result['value'];         }     } ?> 

Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -