Checkboxes instead of drop down list in PHP, MySQL -


i have working code below, i'd change drop down list checkboxes, multiple options can selected , passed further action instead of 1 drop down list allows. i'm fairy new php , have done tons of searching on without success. appreciated.

    $l = $_post['lt'];     $pals = '';      $r = mysql_query("select distinct pal_num pl_tab lt_num='$l'");      while($row = mysql_fetch_assoc($r))     {         $pals .= '<option>'.$row['pal_num'].'</option>';      }      if($pal == '')         echo '';     else      echo '<form name="get_pal" action="post.php" method="post">';     echo '<select name="pal_numb"><option>select pal</option>'.$pals.'</select>';     echo '<input type="submit" name="post" value="go!">';     echo '</form>'; 

with checkbox

<?php     $l = $_post['lt'];     $pals = '';      $r = mysql_query("select distinct pal_num pl_tab lt_num='$l'");      while($row = mysql_fetch_assoc($r))     {         $pals .= '<input type="checkbox" name="pal_numb[]" value="'.$row['pal_num'].'">'.$row['pal_num'].'<br>';     }      if($pal == '')         echo '';     else     echo '<form name="get_pal" action="post.php" method="post">';     echo $pals;     echo '<input type="submit" name="post" value="go!">';     echo '</form>'; ?> 

with select multiple

append multiple select below @sudhakar said

 echo '<select name="pal_numb" multiple><option>select pal</option>'.$pals.'</select>'; 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -