db performance

From: Date: Thu, 21 Jun 2001 15:05:00 +0000
Subject: db performance
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-7966@lists.php.net to get a copy of this message
Hi- I have a Microsoft SQL 2000 server that I am running a simple query from. It is taking up to a minute to call. Running IIS 5.0, IE 5.5. Any thoughts? I checked the following: 1-A similar ASP script is fine. 2-I can ping the server 3-In MS Query analyzer it takes milliseconds to finish Here is the code: <select name="RESORT_ID"> <option value="All">Search All Resorts</option> <? $connection = mssql_connect("scott", "blah", "blah!!") or die ("Can't connect to db server"); $db = mssql_select_db("webdb", $connection) or die ("Can't select db!"); $sql = "select resort_id,resort_name from resort order by resort_name"; $sql_result = mssql_query($sql,$connection) or die ("Can't run query!"); while ($row = mssql_fetch_array($sql_result)){ $resort_id = $row["resort_id"]; $resort_name = $row["resort_name"]; echo "<option value=\"$resort_id\">$resort_name</option>"; } mssql_free_result($sql_result); mssql_close($connection); ?> </select>

« previous php.windows (#7966) next »