示例#1
0
        public static object GetField(PhpResource resultHandle, int rowIndex, object field)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

            ScriptContext context = ScriptContext.CurrentContext;

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

            string field_name;
            object field_value;

            if (field == null)
            {
                field_value = result.GetFieldValue(rowIndex, result.CurrentFieldIndex);
            }
            else if ((field_name = PhpVariable.AsString(field)) != null)
            {
                field_value = result.GetFieldValue(rowIndex, field_name);
            }
            else
            {
                field_value = result.GetFieldValue(rowIndex, Core.Convert.ObjectToInteger(field));
            }

            return(Core.Convert.Quote(field_value, context));
        }
示例#2
0
        public static PhpObject FetchField(PhpResource resultHandle, int fieldIndex)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

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

            return(FetchFieldInternal(result, fieldIndex));
        }
示例#3
0
        public static bool DataSeek(PhpResource resultHandle, int rowIndex)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

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

            return(result.SeekRow(rowIndex));
        }
示例#4
0
        public static bool FieldSeek(PhpResource resultHandle, int fieldOffset)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

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

            return(result.SeekField(fieldOffset));
        }
示例#5
0
        public static int FieldLength(PhpResource resultHandle, int fieldIndex)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

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

            return(result.GetFieldLength(fieldIndex));
        }
示例#6
0
        public static string FieldType(PhpResource resultHandle, int fieldIndex)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

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

            return(result.GetPhpFieldType(fieldIndex));
        }
示例#7
0
        public static string FieldName(PhpResource resultHandle)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

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

            return(result.GetFieldName());
        }
示例#8
0
        public static bool NextResult(PhpResource resultHandle)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

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

            return(result.NextResultSet());
        }
示例#9
0
        public static int GetRowCount(PhpResource resultHandle)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

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

            return(result.RowCount);
        }
示例#10
0
        public static PhpObject FetchObject(PhpResource resultHandle)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

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

            return(result.FetchObject());
        }
示例#11
0
        public static bool FreeResult(PhpResource resultHandle)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

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

            result.Close();
            return(true);
        }
示例#12
0
        public static PhpArray FetchArray(PhpResource resultHandle, QueryResultKeys resultType)
        {
            PhpSqlDbResult result = PhpSqlDbResult.ValidResult(resultHandle);

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

            switch (resultType)
            {
            case QueryResultKeys.ColumnNames: return(result.FetchArray(false, true));

            case QueryResultKeys.Numbers: return(result.FetchArray(true, false));

            case QueryResultKeys.Both: return(result.FetchArray(true, true));
            }

            return(null);
        }