Help with formatting results
Posted: Fri Dec 01, 2006 12:06 am
I am trying to get some results into a table and am not sure how to make it work as I would like.
The problem is that I changed the format for storing a users name in the db form “name” to “first_name” and “last_name” now my table has one more column than I want, I want first name and last name in the same cell... But am not sure the best way to do it?
What I have:
A table with all the results inserted in order and then two form option at the end of the row.
The problem is that I changed the format for storing a users name in the db form “name” to “first_name” and “last_name” now my table has one more column than I want, I want first name and last name in the same cell... But am not sure the best way to do it?
What I have:
A table with all the results inserted in order and then two form option at the end of the row.
Code: Select all
// Format the results table
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><h2>Members, $today</h2>";
// Set the headings
echo "<tr><td><h2>Member Name</h2></td><td><h2>Call Sign</h2></td><td><h2>Phone</h2></td><td><h2>Mem. Expites</h2></td><td><h2>Mem. ID</h2></td><td><h2>Options</h2></td></tr>";
// Poop out some date!
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$pn_uname = $line['pn_uname']; // need this for the form, in table.
$name = $line['pn_first_name'] ['pn_last_name']; // also need this for the form, in table.
echo "<tr>";
foreach ($line as $col_value) {
echo "<td><div align=\"center\">$col_value</div></td>";
}
echo '<td><div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="table2">
<tr>
<td class="memform"><div align="center">
<form action="mem_search.php" method="post"><input type="hidden" name="call" value="' . $pn_uname .'" />
<input type="image" src="/images/edit_icon_16.gif" alt="Edit" title="Edit ' . $pn_uname .' Information" />
</form></div>
</td>
<td class="memform"><div align="center"><form action="mem_drop_user.php" method="post">
<input type="hidden" name="call" value="' . $pn_uname .'" />
<input type="hidden" name="name" value="' . $name .'" />
<input type="image" src="/images/button_cancel_16.gif" alt="Delete" title="Delete This Member" />
</form></div>
</td>
</tr>
</table>
</div></td>';
echo "</tr>";
}
echo "</table>";