Hello All

I run the simple code to display data from the database.  There are around
5000 records and 50 fields.  It takes around 1 1/2 min to retrieve the
data to the browser.  I'd like to know if we can improve my code.  So, I
can retrieve the data in a shorter period of time.  I have codes as

$conn = (mssql_connect("","hello","hello")) or die("Cannot
connect to the database.");

$strSQL = "Select * from dss_student order by stuidterm";
$rs = mssql_query($strSQL,$conn) or die("Cannot connect to the table");

echo "<table border='0' cellspace=1><tr>";
echo "<th bgcolor='#faf0e6'><font face='verdana' size=2>NO.</font></th>";

while($fld = mssql_fetch_field($rs)){
                echo "<th bgcolor='#faf0e6'><font face='verdana' size=2>" . $fld->name 

echo "</tr>";

$no_row = 1;
while ($row = mssql_fetch_row($rs)){ 
if (($no_row % 2) == 1) 
        echo "<tr>";
    echo "<tr bgcolor='#faf0e6'>";

echo "<td><font face='verdana' size=2>$no_row</font></td>";
for ($i=0;$i<=49;$i++)
        echo "<td><font face='verdana' size=2>$row[$i]</font></td>";
echo "</table>";


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

Reply via email to