Changeset:
f4d2e7a888ce
https://sourceforge.net/p/mrbs/hg-code/ci/f4d2e7a888ce4d7208fed26d0e09471d930cba02
Author:
Campbell Morrison <[email protected]>
Date:
Tue Sep 20 16:10:48 2016 +0100
Log message:
Removed debug code and switched to try ... catch.
diffstat:
web/mysqli.inc | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diffs (36 lines):
diff -r 0f7b141a8228 -r f4d2e7a888ce web/mysqli.inc
--- a/web/mysqli.inc Tue Sep 20 15:25:21 2016 +0100
+++ b/web/mysqli.inc Tue Sep 20 16:10:48 2016 +0100
@@ -53,19 +53,24 @@
function sql_mysqli_command ($sql, $params = array(), $db_conn = null)
{
sql_mysqli_ensure_handle($db_conn);
+
+ $ret = -1;
- $ret = -1;
-
- trigger_error($sql, E_USER_WARNING);
- trigger_error(print_r($params, true), E_USER_WARNING);
-
- $sth = $db_conn->prepare($sql);
- $sth->execute($params);
- trigger_error(print_r($sth->errorInfo(), true), E_USER_WARNING);
+ try
+ {
+ $sth = $db_conn->prepare($sql);
+ $sth->execute($params);
+ }
+ catch (PDOException $e)
+ {
+ return $ret;
+ }
+
if ($sth)
{
$ret = $sth->rowCount();
}
+
return $ret;
}
------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits