Hi,
I have the following code, which pulling informtion from a table, and displays it in a table. The problem I'm having is, how do I put column names in? I tried adding another coloumn before the <td>$rs[1]</td> like
<td>Header 1</td> but this put coloum headers above ever record it found. So you'd end up with 5 rows, each with a header. Can anyone see how to solve this?
mysql_select_db("dbase");
$sql="SELECT * FROM table WHERE country='$country'";
$result=db_query($sql);
if (!$result || db_numrows($result) < 1) {
echo 'Sorry No Users In That Country';
} else {
while($rs=mysql_fetch_array($result)){
echo "<tr>
<td>$rs[1]</td>
<td>$rs[2]</td>
<td>$rs[3]</td>
<td>$rs[4]</td>
</tr>\n";
}
}
I'd like...
|Header 1|Header 2|Header 3|Header 4|
| $rs[1] | $rs[2] | $rs[3] | $rs[4] |
| $rs[1] | $rs[2] | $rs[3] | $rs[4] |
Cheers
Ben