HELP to create two columns combo

How I can create a two cloumns combo list and pull information from MYSQL database table?


There is no easy way to create two columns combo in html. You can implement this using CSS/Javascript, but this will not be regular element. Try to look at demos section on jQuery, Mootools and other javascript frameworks.

As for populating MySQL query results into two columns, here is the code:


<?php $n = 2; // number of columns to display // query mysql database $r = mysql_query("select FieldName1, ID from SAMPLETABLE order by FieldName1"); echo ''; for($i=0;$i<mysql_num_rows($r);$i++){ $f = mysql_fetch_array($r); if($i%$n==0) echo ''; echo ''; if($i%$n==$n-1) echo ''; } $k=$i%$n; if($k!=0){ for($i=$k;$i<$n;$i++){ echo ''; } echo ''; } echo '
'; ?>


Sponsor our Newsletter | Privacy Policy | Terms of Service