function isUpdateQuery($str_query = NULL) { if (nonZeroString($str_query)) { $pattern = "/^[ ]*update[^;]+;[ ]*\$/i"; return preg_match($pattern, $str_query); } return false; }
function connectDB($host, $user, $pword, $DB) { if (nonZeroString($host) && nonZeroString($user) && nonZeroString($DB) && nonZeroString($pword)) { $mysqli = new Mysqli($host, $user, $pword, $DB); if (!$mysqli->connect_errno) { return $mysqli; } } return NULL; }