Will this work for you?

        $numFields = mysql_num_fields($Results);
        
        print "<table>";
        while ($Row = mysql_fetch_array($Results))
        {
                print "<tr>";
                for ($i = 0; $ < $numFields; $i++)
                        print "<td>".$Row[$i]."</td>";
                print "</tr>";
        }
        print "</table>";



-----Original Message-----
I was wondering if the following might work:

$cells = 10; //set desired number of cells per column
$numRows = mysql_num_rows($result); //determine number of rows
$numCols = ceil($numRows/$cells); //determine number of columns needed

print "<center><table width=\"100%\" border=\"0\" cellpadding=\"0\" 
cellspacing=\"0\">\n"; //start main table

for($i=0; $i<$numCols; $i++) { 

echo "<tr><td align=\"center\">\n"; //setup main row/cell

echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0
\">\n"; //setup secondary table

        while($dataArray = mysql_fetch_array($result)) { //print 
results of SQL in secondary table
                extract($dataArray);
                $n++;
                
                printf("<tr>\n<td align=\"center\" valign=\"center\"><a 
href=\"year.asp?year=%\">%s</td>\n</tr>", $grad_year, $grad_year);

                if ($n==$cols) {
                        echo "</table>"\n; //close secondary table at 
10 cells
                        }  

echo "</td></tr>\n"; //close main row/cell

}

echo "</table>\n"; //close main table

 
****************************************************************************
This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.                                                                       

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to