RE: [PHP-WIN] MS SQL Query question

From: Date: Tue, 25 May 2004 19:04:36 +0000
Subject: RE: [PHP-WIN] MS SQL Query question
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-23831@lists.php.net to get a copy of this message
try something like this $result = mssql_query ($query); if ($result) { while ($template_args = msssql_fetch_array ($res)) { //what ever you want to do with the data } } Derrick Hermanson Programmer/Analyst I Acton International LTD. 402.470.5816 mailto:dhermanson@acton.com -----Original Message----- From: Ron.Herhuth@tatumpartners.com [mailto:Ron.Herhuth@tatumpartners.com] Sent: Tuesday, May 25, 2004 1:30 PM To: php-windows@lists.php.net Subject: [PHP-WIN] MS SQL Query question When I run a query the syntax looks like this: $result = mssql_query($query); $numRows = mssql_num_rows($result); for($i=0; $i<$numRows; $i++) { $row = mssql_fetch_array($result); } but if I go to try and loop through the resultset again it wont work unless I run this line again "$result = mssql_query($query);" I'm sure this is wasting resources but I can't seem to get around it. Any suggestions? Thanks, Ron

« previous php.windows (#23831) next »