note 87960 added to function.odbc-num-rows
| From: | jeff at script-xs dot com | Date: | Fri, 02 Jan 2009 19:34:21 +0000 |
| Subject: | note 87960 added to function.odbc-num-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148761@lists.php.net to get a copy of this message | ||
After minutes of frustration, I realized why odbc_num_rows was not returning the number of affected
rows on a prepared update query. I'm using ODBC to connect to Microsot SQL Server 2005.
My corrected code:
$query = odbc_prepare($conn, 'UPDATE table SET cat = ? WHERE id = 1');
$result = odbc_execute($query, $category);
$affected = odbc_num_rows($query);
This code works. I was frustrated that odbc_num_rows($result) didn't work as I expected, but
instead required me to pass the original prepared query to this function.
----
Server IP: 209.41.74.194
Probable Submitter: 66.60.152.50
----
Manual Page -- http://www.php.net/manual/en/function.odbc-num-rows.php
Edit -- https://master.php.net/note/edit/87960
Del: integrated -- https://master.php.net/note/delete/87960/integrated
Del: useless -- https://master.php.net/note/delete/87960/useless
Del: bad code -- https://master.php.net/note/delete/87960/bad+code
Del: spam -- https://master.php.net/note/delete/87960/spam
Del: non-english -- https://master.php.net/note/delete/87960/non-english
Del: in docs -- https://master.php.net/note/delete/87960/in+docs
Del: other reasons-- https://master.php.net/note/delete/87960
Reject -- https://master.php.net/note/reject/87960
Search -- https://master.php.net/manage/user-notes.php