PHP - Get affected rows in ADODB -
i using adodb create connection database. update data in database, there no error. problem can't number of affected rows affected_rows()
. tried simple code not working. here code:
$sql = "update user set name=n'myname' id=1"; $conn = new com ("adodb.connection") or die("cannot start ado"); $cs = "provider=sqloledb;"."server=localhost;database=test;uid=admin;pwd=123456;max pool size=100"; $conn->open($cs); //there no error in connecting process. can add, update, delete normally. if($conn->execute($sql) === false) { trigger_error('wrong sql: ' . $sql . ' error: ' . $conn->errormsg(), e_user_error); } else { echo $conn->affected_rows(); //<-- error in here }
i have read function in here. code above same example here. there other way number of affected rows in adodb-php?
about affected_rows()
, don't know why isn't working. there simple way number of affected rows after execute query.
$conn->execute($sql,$affected_rows); echo $affected_rows;
$affected_rows
return execute function have value equal number of affected rows of query.
Comments
Post a Comment