Req #28526 [Opn->Csd]: Add 'dbx_num_affected_rows' function

From: Date: Wed, 23 Aug 2017 00:25:00 +0000
Subject: Req #28526 [Opn->Csd]: Add 'dbx_num_affected_rows' function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210773@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=28526&edit=1

 ID:                 28526
 Updated by:         kalle@php.net
 Reported by:        johnw at sussex dot ac dot uk
 Summary:            Add 'dbx_num_affected_rows' function
-Status:             Open
+Status:             Closed
 Type:               Feature/Change Request
 Package:            DBX related
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        kalle
 Block user comment: N
 Private report:     N

 New Comment:

Gonna close this as the DBX package has no activity, if an active maintainer takes it over then
please re-open


Previous Comments:
------------------------------------------------------------------------
[2004-06-10 09:47:03] mboeren@php.net

Luckily, there is also a $result->handle that you can use :-)

------------------------------------------------------------------------
[2004-06-10 00:54:09] johnw at sussex dot ac dot uk

Thanks for the suggestion but unfortunately I am using 
Oracle (OCI8) where the 'native' function for getting 
the number of affected rows needs to be applied to the 
statement handle returned by OCIParse, not the 
connection handle returned by OCILogon.

------------------------------------------------------------------------
[2004-06-08 14:35:14] mboeren@php.net

While waiting for someone to actually implement this, the following snippet (untested) might be
useful:

$link = dbx_connect(DBX_MYSQL, "localhost", "db", "username",
"password");
$result = dbx_query($link, "DELETE FROM table WHERE name=''");
echo mysql_affected_rows($link->handle);


------------------------------------------------------------------------
[2004-05-26 13:43:56] johnw at sussex dot ac dot uk

Description:
------------
It would be very useful (to me at least) if the dbx 
module included a function for returning the number of 
rows affected by an INSERT, UPDATE, or DELETE statement.

Implementation suggestion: the function DBX_QUERY could
call the relevant database-specific function after an
update/insert/delete and save the result in the link
identifier object. A new function DBX_NUM_AFFECTED_ROWS
would retrieve this saved value from the link 
identifier.

Possibly a select query would cause the 
'num_affected_rows' value to be set to 0, for neatness.




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=28526&edit=1


Thread (5 messages)

« previous php.bugs (#210773) next »