Re: Table Making
| From: | Analysis & Solutions | Date: | Thu, 11 Jul 2002 06:12:53 +0000 |
| Subject: | Re: Table Making | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-107029@lists.php.net to get a copy of this message | ||
Jason:
On Wed, Jul 10, 2002 at 10:04:45PM -0800, Jason Soza wrote:
>
> I have this nice piece of code to take my SQL result and organize it into a
> nice 5 column table:
Nice is in the eye of the beholder... Here's what I think is nice:
echo "<table width=\"100%\" border=\"0\"
align=\"center\">\n";
echo " <tr>\n";
while ($row = mysql_fetch_array($sql, MYSQL_ASSOC)) {
echo ' <td align="center"><a href="year.asp?year=';
echo $row['grad_year'] . '">' . $row['grad_year'] .
"</a></td>\n";
}
echo " </tr>\n";
echo "</table>\n\n";
If you want to reverse the order, use an ORDER BY clause in your query
string.
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409