name; } else { return false; } } /** * Get the name of the specified field in a result * * @param mysqli_result $result * @param int $field_offset * @return bool|string */ function mysql_fieldname($result, $field_offset) { return mysql_field_name($result, $field_offset); } /** * Get name of the table the specified field is in * * @param mysqli_result $result * @param int $field_offset * @return bool|string */ function mysql_field_table($result, $field_offset) { $fieldInfo = mysqli_fetch_field_direct($result, $field_offset); if (is_object($fieldInfo)) { return $fieldInfo->table; } else { return false; } } /** * Get name of the table the specified field is in * * @param mysqli_result $result * @param int $field_offset * @return bool|string */ function mysql_fieldtable($result, $field_offset) { return mysql_field_table($result, $field_offset); } /** * Returns the length of the specified field * * @param mysqli_result $result * @param int $field_offset * @return bool|int */ function mysql_field_len($result, $field_offset) { $fieldInfo = mysqli_fetch_field_direct($result, $field_offset); if (is_object($fieldInfo)) { return $fieldInfo->length; } else { return false; } } /** * Returns the length of the specified field * * @param mysqli_result $result * @param int $field_offset * @return bool|int */ function mysql_fieldlen($result, $field_offset) { return mysql_field_len($result, $field_offset); } /** * Get the type of the specified field in a result * * @param mysqli_result $result * @param int $field_offset * @return bool|int */ function mysql_field_type($result, $field_offset) { $fieldInfo = mysqli_fetch_field_direct($result, $field_offset); if (is_object($fieldInfo)) { return $fieldInfo->type; } else { return false; } } /** * Get the type of the specified field in a result * * @param mysqli_result $result * @param int $field_offset * @return bool|int */ function mysql_fieldtype($result, $field_offset) { return mysql_field_type($result, $field_offset); } /** * Get the flags associated with the specified field in a result * * @param mysqli_result $result * @param int $field_offset * @return bool|string */ function mysql_field_flags($result, $field_offset) { $fieldInfo = mysqli_fetch_field_direct($result, $field_offset); if (is_object($fieldInfo)) { return $fieldInfo->flags; } else { return false; } } /** * Get the flags associated with the specified field in a result * * @param mysqli_result $result * @param int $field_offset * @return bool|string */ function mysql_fieldflags($result, $field_offset) { return mysql_field_flags($result, $field_offset); } /** * Escapes a string for use in a mysql_query * * @param string $unescaped_string * @return string */ function mysql_escape_string($unescaped_string) { return mysql_real_escape_string($unescaped_string); } /** * Escapes a string for use in a mysql_query * * @param string $unescaped_string * @param mysqli $link * @return string */ function mysql_real_escape_string($unescaped_string, $link = null) { //todo return mysqli_real_escape_string(mysqli_tool::linkProcess($link), $unescaped_string); } /** * Get current system status * * @param mysqli $link * @return bool|string */ function mysql_stat($link = null) { return mysqli_stat(mysqli_tool::linkProcess($link)); } /** * Return the current thread ID * * @param mysqli $link * @return int */ function mysql_thread_id($link = null) { return mysqli_thread_id(mysqli_tool::linkProcess($link)); } /** * Returns the name of the character set * * @param mysqli $link * @return string */ function mysql_client_encoding($link = null) { return mysqli_character_set_name(mysqli_tool::linkProcess($link)); } /** * Ping a server connection or reconnect if there is no connection * * @param mysqli $link * @return bool */ function mysql_ping($link = null) { return mysqli_ping(mysqli_tool::linkProcess($link)); } /** * Get MySQL client info * * @return string */ function mysql_get_client_info() { return mysqli_get_client_info(); } /** * Get MySQL host info * * @param mysqli $link * @return string */ function mysql_get_host_info($link = null) { return mysqli_get_host_info(mysqli_tool::linkProcess($link)); } /** * Get MySQL protocol info * * @param mysqli $link * @return bool|int */ function mysql_get_proto_info($link = null) { return mysqli_get_proto_info(mysqli_tool::linkProcess($link)); } /** * Get MySQL server info * * @param mysqli $link * @return string */ function mysql_get_server_info($link = null) { return mysqli_get_server_info(mysqli_tool::linkProcess($link)); } /** * Get information about the most recent query * * @param mysqli $link * @return bool|string */ function mysql_info($link = null) { return mysqli_info(mysqli_tool::linkProcess($link)); } /** * Sets the client character set * * @param string $charset * @param mysqli $link * @return bool */ function mysql_set_charset($charset, $link = null) { return mysqli_set_charset(mysqli_tool::linkProcess($link), $charset); } /** * Execute SQL, used database will changed * * @param $database_name * @param $query * @param $link * @return bool|mysqli_result */ function mysql($database_name, $query, $link) { return mysql_db_query($database_name, $query, $link); } }