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

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -