/// <summary> /// Closes a previously opened database connection. /// </summary> public static bool mysqli_close(mysqli link) { if (link != null) { return(link.close()); } else { PhpException.ArgumentNull(nameof(link)); return(false); } }
/// <summary> /// Selects the default database for database queries. /// </summary> public static bool mysqli_select_db(mysqli link, string dbname) { if (link != null) { return(link.select_db(dbname)); } else { PhpException.ArgumentNull(nameof(link)); return(false); } }
//int $num_rows; //int $param_count; //string $sqlstate; /* Methods */ /// <summary> /// Constructs the object. /// </summary> public void __construct([NotNull] mysqli link, string query = null) { if (link == null) { throw new ArgumentNullException(nameof(link)); } Connection = link.Connection; if (query != null) { prepare(query); } }
/// <summary> /// Used for establishing secure connections using SSL /// </summary> /// <returns>Always true.</returns> public static bool mysqli_ssl_set(mysqli link, string key = null, string cert = null, string ca = null, string capath = null, string cipher = null) => link.ssl_set(key, cert, ca, capath, cipher);
/// <summary> /// Prepare an SQL statement for execution. /// </summary> //[return: CastToFalse] public static mysqli_stmt mysqli_prepare(mysqli link, string query = null) => new mysqli_stmt(link, query);
/// <summary> /// Constructs the object. /// </summary> public mysqli_stmt([NotNull] mysqli link) : this(link, null) { }
/// <summary> /// Returns the version of the MySQL server. /// </summary> public static string mysqli_get_server_info(mysqli link) => link.server_info;
/// <summary> /// Get MySQL client info. /// </summary> public static string mysqli_get_client_info(mysqli link = null) => mysqli.ClientInfo;
/// <summary> /// Returns the error code from last connect call. /// </summary> public static int mysqli_connect_errno(Context ctx, mysqli link = null) => (link != null) ? link.connect_errno : string.IsNullOrEmpty(MySqliContextData.GetContextData(ctx).LastConnectionError) ? 0 : -1;
/// <summary> /// Returns the thread ID for the current connection. /// </summary> public static int mysqli_thread_id(mysqli link) => link.thread_id;
/// <summary> /// Opens a connection to a mysql server /// </summary> public static bool mysqli_real_connect(Context ctx, mysqli link, string host = null, string username = null, string passwd = null, string dbname = "", int port = -1, string socket = null, int flags = 0) => link.real_connect(ctx, host, username, passwd, dbname, port, socket, flags);
/// <summary> /// Check if there are any more query results from a multi query. /// </summary> public static bool mysqli_more_results(mysqli link) => link.more_results();
/// <summary> /// Prepare next result from multi_query. /// </summary> public static bool mysqli_next_result(mysqli link) => link.next_result();
/// <summary> /// Returns the default character set for the database connection. /// </summary> public static string mysqli_character_set_name(mysqli link) => link.character_set_name();
/// <summary> /// Returns the default character set for the database connection. /// </summary> public static string mysqli_client_encoding(mysqli link) => link.character_set_name();
/// <summary> /// Returns the MySQL client version as an integer. /// </summary> public static int mysqli_get_client_version(mysqli link = null) => mysqli.ClientVersion;
/// <summary> /// Pings a server connection, or tries to reconnect if the connection has gone down. /// </summary> public static bool mysqli_ping(mysqli link) => link.ping();
/// <summary> /// Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connection. /// </summary> public static PhpString mysqli_real_escape_string(mysqli link, PhpString escapestr) => link.real_escape_string(escapestr);
/// <summary> /// Returns a string representing the type of connection used. /// </summary> public static string mysqli_get_host_info(mysqli link) => link.host_info;
/// <summary> /// Returns a string description of the last error. /// </summary> public static string mysqli_error(mysqli link) => link.error;
/// <summary> /// Opens a connection to a mysql server /// </summary> public static mysqli mysqli_connect(Context ctx, string host = null, string username = null, string passwd = null, string dbname = "", int port = -1, string socket = null, int flags = 0) { var link = new mysqli(ctx, host, username, passwd, dbname, port, socket); return((string.IsNullOrEmpty(link.connect_error)) ? link : null); }
/// <summary> /// Returns the version of the MySQL server as an integer. /// </summary> public static int mysqli_get_server_version(mysqli link) => link.server_version;
/// <summary> /// Gets the number of affected rows in a previous MySQL operation. /// </summary> public static int mysqli_affected_rows(mysqli link) => link.affected_rows;
/// <summary> /// Performs a query on the database. /// </summary> public static PhpValue mysqli_query(mysqli link, PhpString query, int resultmode = Constants.MYSQLI_STORE_RESULT) { PhpException.ThrowIfArgumentNull(link, 1); return(link.query(query, resultmode)); }
/// <summary> /// The connection error message. Otherwise <c>null</c>. /// </summary> public static string mysqli_connect_error(Context ctx, mysqli link = null) => (link != null) ? link.connect_error : MySqliContextData.GetContextData(ctx).LastConnectionError;
/// <summary> /// Returns the number of columns for the most recent query on the connection. /// </summary> public static int mysqli_field_count(mysqli link) => link.field_count;
/// <summary> /// Returns the auto generated id used in the latest query. /// </summary> public static long mysqli_insert_id(mysqli link) => link.insert_id;
/// <summary> /// Used to set extra connect options and affect behavior for a connection. /// </summary> public static bool mysqli_options(mysqli link, int option, PhpValue value) => link.options(option, value);
/// <summary> /// Constructs the object. /// </summary> public mysqli_stmt([NotNull] mysqli link, string query) { __construct(link, query); }
/// <summary> /// Sets the default client character set. /// </summary> public static bool mysqli_set_charset(mysqli link, string charset) => link.set_charset(charset);