Record diplay according to type

Hi guys,

I have a form which has 3 fields.

1.name
2.address
3.type

name is input field
address is input filed
type is drop down list.a,b,c in drop down list.
when submit the form it will store in database.

Input record like that:

name address type
amit delhi a
amit delhi b
amit delhi c
amit mumbai a
sumit delhi a

I wana display this record according to type.

name address A B C(this is like header)
amit delhi a b c
amit mumbai a
sumit delhi a

I wana display record in excel this format.

it would be appreciated if u can help me.

Thanks
amit

First thing is to have your sql query return all the records in the correct order.

“select name, address, type from table order by name, address, type”

Does that get you all your records in the correct order? And does that apply to all the use-cases for name for example (is that a first name or family name, will name contain a mixture of first/last names?)

<table cellspacing=“0” cellpadding=“0”>
<tr>
<td width=“355”><table width=“100%” border=“0” cellpadding=“0”>
<tr>
<td width=“18%”><div align=“right”>Name</div></td>
<td width=“5%”> </td>
<td width=“77%”><input type=“text” name=“name”></td>
</tr>
<tr>
<td><div align=“right”>Address</div></td>
<td> </td>
<td><input type=“text” name=“name2”></td>
</tr>
<tr>
<td><div align=“right”>Type</div></td>
<td> </td>
<td><select name=“type”><option value=“A”>A<option value=“B”>B<option value=“C”>C<option value=“D”>D</select></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type=“submit” name=“submit” value=“submit”></td>
</tr>
<tr>
<td><div align=“right”></div></td>
<td> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height=“100”><table border=“1” cellpadding=“5” cellspacing=“0” width=“93%”>
<tbody>
<tr align=“left”>
<th width=“30%” align=“left”>NAME</th>
<th width=“23%”>Address</th>
<th width=“24%”>a</th>
<th width=“23%”>b</th>
<th width=“23%”>c</th>
</tr>
<tr>
<td valign=“top”>amit</td>
<td valign=“top”>delhi</td>
<td valign=“top”>a</td>
<td valign=“top”>b</td>
<td valign=“top”>c</td>
</tr>
<tr>
<td valign=“top”>amit</td>
<td valign=“top”>mumbai</td>
<td valign=“top”><table cellpadding=“5” cellspacing=“0”>
</table>
a</td>
<td valign=“top”><table cellpadding=“5” cellspacing=“0”>
</table></td>
<td valign=“top”> </td>
</tr>
<tr>
<td valign=“top”>sumit</td>
<td valign=“top”>delhi</td>
<td valign=“top”>a</td>
<td valign=“top”> </td>
<td valign=“top”> </td>
</tr>
</tbody>
</table></td>
</tr>
</table>

display record like this

If i do query group by name but it doesnot show

So what do you want help with, displaying the records or getting them out of the database?

displaying the record in excel format

i thnk u did not get my point cups