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
follows:

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

$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 
.
"</font></th>";          
        }

echo "</tr>";

$no_row = 1;
while ($row = mssql_fetch_row($rs)){ 
if (($no_row % 2) == 1) 
        echo "<tr>";
else 
    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>";
$no_row++;
}
echo "</table>";
mssql_close();

POng



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

Reply via email to