note 46545 added to ref.mssql
| From: | zac at zacbowling dot com | Date: | Fri, 15 Oct 2004 01:04:42 +0000 |
| Subject: | note 46545 added to ref.mssql | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78562@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;
}
?>
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+46545
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46545&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46545&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46545&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46545&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46545&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46545&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46545&report=yes
Search -- http://master.php.net/manage/user-notes.php