note 46546 added to ref.mssql

From: Date: Fri, 15 Oct 2004 01:06:44 +0000
Subject: note 46546 added to ref.mssql
Groups: php.notes 
Request: Send a blank email to php-notes+get-78563@lists.php.net to get a copy of this message
This is the function I use to get rowcount. I hacked up a function out of PEAR to make it work. Just call it right after you make a successful query and your done. <?php function rowcount($conn) { $q = @mssql_query('select @@rowcount', $conn); if (!$q) { die("NO ROW COUNT."); } $ar = @mssql_fetch_row($q); if (!$ar) { $result = 0; } else { @mssql_free_result($q); $result = $ar[0]; } return $result; } ?> Hope that helps anyone who finds it useful :-) --- Zac Bowling http://www.zacbowling.com ---- Manual Page -- http://www.php.net/manual/en/ref.mssql.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46546 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46546&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46546&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46546&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46546&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46546&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46546&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+46546&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#78563) next »