* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
}
// SQL affected rows
-function SQL_AFFECTEDROWS() {
+function SQL_AFFECTEDROWS () {
// Valid link resource?
if (!SQL_IS_LINK_UP()) return FALSE;
* working database link.
*/
SQL_SET_LINK(__FUNCTION__, __LINE__, $linkResource);
+
+ // Init charsets (UTF-8 is default now)
+ SQL_QUERY("SET
+ `character_set_results`='utf8',
+ `character_set_client`='utf8',
+ `character_set_connection`='utf8',
+ `character_set_database`='utf8',
+ `character_set_server`='utf8'", __FUNCTION__, __LINE__);
} // END - if
// Return the resource
return $res;
}
-// Get id from last INSERT command
-function SQL_INSERTID () {
+// Get id from last INSERT command and secure id
+function SQL_INSERT_ID () {
if (!SQL_IS_LINK_UP()) return FALSE;
- return mysql_insert_id();
+ return bigintval(mysql_insert_id());
}
// Escape a string for the database
// Remember plain error in last_sql_error
$GLOBALS['last_sql_error'] = mysql_error();
+ // Is login set?
+ if (isset($GLOBALS['mysql']['login'])) {
+ // Secure login name in message
+ $message = str_replace($GLOBALS['mysql']['login'], '***', $message);
+ } // END - if
+
+ // Is database password set?
+ if (isset($GLOBALS['mysql']['password'])) {
+ // Secure password in message
+ $message = str_replace($GLOBALS['mysql']['password'], '***', $message);
+ } // END - if
+
+ // Is database name set?
+ if (isset($GLOBALS['mysql']['dbase'])) {
+ // Secure database name in message
+ $message = str_replace($GLOBALS['mysql']['dbase'], '***', $message);
+ } // END - if
+
// Is there installation phase?
if (isInstallationPhase()) {
/*