The code is fine. But I have one problem, when the ListBox display the data it gives me extra empty lines. How can I get rid of these lines? < -------- ListBox Code -----------------------------------------------------------------------------------> echo"<table border='1' cellspacing='1' cellpadding='3' bordercolor= 'CDCB98'>"; echo'<form name="myform" method="post" action="sfd.php">'; $result = mysql_query('select * from lo_data'); echo"<tr bgcolor='CDCB98'>"; echo "<td>" ; echo"<select NAME='Cat' onchange='resubmit()'>"; echo"<option value='NULL'>Select Search Item</option>"; $i=0; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { foreach ($line as $col) { $field=mysql_field_name($result,$i); $array[$field] = $col; echo"<OPTION value='$field'"; echo ">$field</OPTION>"; $i++; } } echo "</SELECT>"; echo "</td>"; echo "</form>"; --------------------------------- Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends.