I know how to return the results from a query to a table just fine...but I am needing some help with this.
I am wanting to return some heading on one row...on the next row will be the results...on the third row...more headings and on the fourth row those results.
For example:
Name | Address | City | State | Zip
Doe, John | 123 Main St. | Atlanta | GA | 30303
Telephone # | ID Number | Status
123-456-7890 | 987654321 | Active
So all that would be one record and the next record if their are multiples would list the headings...results...headings...results just like the first one.
Here is my current code for the table portion:
// start results formatting
echo "<TABLE BORDER=.5>";
echo "<tr><th>Name</th><th>Address</th><th>D.O.B.</th><th>Race</th><th>Sex</th><th>Hair</th><th>Eye</th><th>Warrant No.</th><th>Issue Date</th><th>Description</th><th>Degree</th><th>Bond Amount</th><th>Agency</th></tr>";
// format results by row
while ($row = mysql_fetch_array($sql_result)) {
$dob = $row['dob'];
$name = $row['name'];
$description = $row['description'];
$bondamount = $row['bondamount'];
$race = $row['race'];
$sex = $row['sex'];
$degree = $row['degree'];
$hair = $row['hair'];
$eye = $row['eye'];
$address = $row['address'];
$warrantnumber = $row['warrantnumber'];
$issuedate = $row['issuedate'];
$city = $row['city'];
$state = $row['state'];
$agency = $row['agency'];
$dlnumber = $row['dlnumber'];
echo "<TR><td>$name</td><td>$address<br>$city $state<td>$dob</td><td>$race</td><td>$sex</td><td>$hair</td><td>$eye</td><td>$warrantnumber</td><td>$issuedate</td><td>$description</td><td>$degree</td><td>$$bondamount</td><td>$agency</td></tr><tr></TR>";
}
echo "</TABLE>";
if (mysql_num_rows($sql_result)==0)
{
echo "No Records Found";
}
If I did my research right I believe this has something to do with the number of rows or columns...but I'm still confused on how to set it up.
Any suggestions?
Thanks,
Jake