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

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

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

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

            return(connection.SelectDb(databaseName));
        }
Beispiel #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);
        }
Beispiel #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));
        }
Beispiel #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);
        }