예제 #1
0
        public static int GetLastAffectedRows(PhpResource linkIdentifier)
        {
            PhpSqlDbConnection connection = PhpSqlDbConnection.ValidConnection(linkIdentifier);

            if (connection == null)
            {
                return(-1);
            }

            return(connection.LastAffectedRows);
        }
예제 #2
0
        public static bool SelectDb(string databaseName, PhpResource linkIdentifier)
        {
            PhpSqlDbConnection connection = PhpSqlDbConnection.ValidConnection(linkIdentifier);

            if (connection == null)
            {
                return(false);
            }

            return(connection.SelectDb(databaseName));
        }
예제 #3
0
        public static bool Close(PhpResource linkIdentifier)
        {
            var connection = PhpSqlDbConnection.ValidConnection(linkIdentifier);

            if (connection == null)
            {
                return(false);
            }

            GetManager().RemoveConnection(connection);

            connection.Close();
            return(true);
        }
예제 #4
0
        public static PhpResource CreateProcedure(string procedureName, PhpResource linkIdentifier)
        {
            PhpSqlDbConnection connection = PhpSqlDbConnection.ValidConnection(linkIdentifier);

            if (connection == null)
            {
                return(null);
            }

            if (procedureName == null)
            {
                PhpException.ArgumentNull("procedureName");
                return(null);
            }

            return(new PhpSqlDbProcedure(connection, procedureName));
        }
예제 #5
0
        public static PhpResource Query(string query, PhpResource linkIdentifier, int batchSize)
        {
            PhpSqlDbConnection connection = PhpSqlDbConnection.ValidConnection(linkIdentifier);

            if (query == null || connection == null)
            {
                return(null);
            }

            PhpSqlDbResult result = (PhpSqlDbResult)connection.ExecuteQuery(query.Trim(), true);

            if (result == null)
            {
                return(null);
            }

            result.BatchSize = batchSize;
            return(result);
        }