@@ -37,7 +37,7 @@ class MySQLConnection
3737 * @param string $password is the user's password
3838 * @param string $charset is the the database charset
3939 */
40- public function __construct ($ serverIP , $ database , $ user , $ password , $ charset = "" )
40+ public function __construct (string $ serverIP , string $ database , string $ user , string $ password , string $ charset = "" )
4141 {
4242 $ this ->fLink = new mysqli ($ serverIP , $ user , $ password , $ database );
4343
@@ -53,17 +53,19 @@ public function __construct($serverIP, $database, $user, $password, $charset = "
5353 }
5454
5555 /**
56- * Escapes special characters in a string for use in an SQL statement
56+ * Escapes special characters in a string for use in an SQL statement,
57+ * taking into account the current charset of the connection.
5758 * @param string $string is the string to escape
58- * @return string string
59+ * @return the escaped string
5960 */
60- public function EscapeString ($ string )
61+ public function EscapeString (string $ string )
6162 {
62- return mysql_real_escape_string ($ string , $ this ->fLink );
63+ //return mysql_real_escape_string($string, $this->fLink);
64+ return mysqli_real_escape_string ($ this ->fLink , $ string );
6365 }
6466
6567 /**
66- * Close MySQLConnection
68+ * Closes this MySQLConnection
6769 */
6870 public function Close ()
6971 {
0 commit comments