#28526 [Opn]: Add 'dbx_num_affected_rows' function
ID: 28526
Updated by: mboeren@php.net
Reported By: johnw at sussex dot ac dot uk
Status: Open
Bug Type: Feature/Change Request
PHP Version: Irrelevant
New Comment:
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);
Previous Comments:
------------------------------------------------------------------------
[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 http://bugs.php.net/?id=28526&edit=1
Thread (5 messages)