示例#1
0
 /// <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);
     }
 }
示例#2
0
 /// <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);
     }
 }
示例#3
0
        //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);
            }
        }
示例#4
0
 /// <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);
示例#5
0
 /// <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);
示例#6
0
 /// <summary>
 /// Constructs the object.
 /// </summary>
 public mysqli_stmt([NotNull] mysqli link)
     : this(link, null)
 {
 }
示例#7
0
 /// <summary>
 /// Returns the version of the MySQL server.
 /// </summary>
 public static string mysqli_get_server_info(mysqli link) => link.server_info;
示例#8
0
 /// <summary>
 /// Get MySQL client info.
 /// </summary>
 public static string mysqli_get_client_info(mysqli link = null) => mysqli.ClientInfo;
示例#9
0
 /// <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;
示例#10
0
 /// <summary>
 /// Returns the thread ID for the current connection.
 /// </summary>
 public static int mysqli_thread_id(mysqli link) => link.thread_id;
示例#11
0
 /// <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);
示例#12
0
 /// <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();
示例#13
0
 /// <summary>
 /// Prepare next result from multi_query.
 /// </summary>
 public static bool mysqli_next_result(mysqli link) => link.next_result();
示例#14
0
 /// <summary>
 /// Returns the default character set for the database connection.
 /// </summary>
 public static string mysqli_character_set_name(mysqli link) => link.character_set_name();
示例#15
0
 /// <summary>
 /// Returns the default character set for the database connection.
 /// </summary>
 public static string mysqli_client_encoding(mysqli link) => link.character_set_name();
示例#16
0
 /// <summary>
 /// Returns the MySQL client version as an integer.
 /// </summary>
 public static int mysqli_get_client_version(mysqli link = null) => mysqli.ClientVersion;
示例#17
0
 /// <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();
示例#18
0
 /// <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);
示例#19
0
 /// <summary>
 /// Returns a string representing the type of connection used.
 /// </summary>
 public static string mysqli_get_host_info(mysqli link) => link.host_info;
示例#20
0
 /// <summary>
 /// Returns a string description of the last error.
 /// </summary>
 public static string mysqli_error(mysqli link) => link.error;
示例#21
0
        /// <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);
        }
示例#22
0
 /// <summary>
 /// Returns the version of the MySQL server as an integer.
 /// </summary>
 public static int mysqli_get_server_version(mysqli link) => link.server_version;
示例#23
0
 /// <summary>
 /// Gets the number of affected rows in a previous MySQL operation.
 /// </summary>
 public static int mysqli_affected_rows(mysqli link) => link.affected_rows;
示例#24
0
        /// <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));
        }
示例#25
0
 /// <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;
示例#26
0
 /// <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;
示例#27
0
 /// <summary>
 /// Returns the auto generated id used in the latest query.
 /// </summary>
 public static long mysqli_insert_id(mysqli link) => link.insert_id;
示例#28
0
 /// <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);
示例#29
0
 /// <summary>
 /// Constructs the object.
 /// </summary>
 public mysqli_stmt([NotNull] mysqli link, string query)
 {
     __construct(link, query);
 }
示例#30
0
 /// <summary>
 /// Sets the default client character set.
 /// </summary>
 public static bool mysqli_set_charset(mysqli link, string charset) => link.set_charset(charset);