Changeset:
fd741544b502
https://sourceforge.net/p/mrbs/hg-code/ci/fd741544b502695eae7a36086cb44fa5fa24e02f
Author:
John Beranek <[email protected]>
Date:
Tue Sep 20 19:12:47 2016 +0100
Log message:
Merged
diffstat:
web/mysqli.inc | 28 ++++++++++++++++++++--------
1 files changed, 20 insertions(+), 8 deletions(-)
diffs (50 lines):
diff -r e22d901a86e9 -r fd741544b502 web/mysqli.inc
--- a/web/mysqli.inc Tue Sep 20 19:10:58 2016 +0100
+++ b/web/mysqli.inc Tue Sep 20 19:12:47 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;
}
@@ -585,6 +590,13 @@
catch (PDOException $e)
{
trigger_error($e->getMessage(), E_USER_WARNING);
+ if ($e->getCode() == 2054)
+ {
+ $message = "It looks like you have an old style MySQL password stored,
which cannot be " .
+ "used with PDO (though it is possible that mysqli may have
accepted it). Try " .
+ "deleting the MySQL user and recreating it with the same
password.";
+ trigger_error($message, E_USER_WARNING);
+ }
echo "\n<p>\n" . get_vocab("failed_connect_db") . "\n</p>\n";
exit;
}
------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits