Returning results from a query and displaying each field
Posted: Wed Jun 18, 2003 2:14 am
Hello all. Here is my HTML code which will format the data I retrieve:
Since this is how the HTML output should look, the variable looking text ($FName and such) should be replaced by the variable.
I want to grab data from a field, such as:
Then I want to take each row and display it's data in its own table. The $FName variables I'm displaying will be the column for that row. How can I go through each row?
Basically I'm just taking the row and outputting it. But I want it to be displayed in my own order and in my own fashion, rather then if I just looped through every field in an array.
Code: Select all
<table width="647" border="1" cellpadding="0" cellspacing="3" bordercolor="#000000">
<tr>
<td colspan="2" rowspan="10" bgcolor="#990000"><p><font color="#FFFFFF">$FName
$LName<br>
$StreetNum $StreetName<br>
$Zip</font></p>
<p><font color="#FFFFFF">$Telephone<br>
$Email </font></p></td>
<td width="171" bgcolor="#FF9933"><strong>Guessed Number</strong></td>
<td width="268" bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td height="20" bgcolor="#FF9933"><strong>Date</strong></td>
<td bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td bgcolor="#FF9933"><strong>Vehicle Year</strong></td>
<td bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td bgcolor="#FF9933"><strong>Make</strong></td>
<td bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td bgcolor="#FF9933"><strong>Model</strong></td>
<td bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td bgcolor="#FF9933"><strong>Last Purchase</strong></td>
<td bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td bgcolor="#FF9933"><strong>Type of Vehicle</strong></td>
<td bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td bgcolor="#FF9933"><strong>Current Payment</strong></td>
<td bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td bgcolor="#FF9933"><strong>Most Important <br>
When Buying</strong></td>
<td bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td bgcolor="#FF9933"><strong>Marketing</strong></td>
<td bgcolor="#CCCCCC"> </td>
</tr>
</table>I want to grab data from a field, such as:
Code: Select all
<?php
$result = mysql_query("SELECT * FROM CustomerEntry WHERE ClientNameID = '$id'");
?>Basically I'm just taking the row and outputting it. But I want it to be displayed in my own order and in my own fashion, rather then if I just looped through every field in an array.