php mssql.dl,mssql_fetch_field

用户评论:

[#1]

not a mail address [2008-08-20 03:22:03]

kubalaa at bigfoot dot com first reported the problem that column_source contains the FIELD name instead of the source TABLE name 04-Apr-2000 03:58. The bug has been reported as well.

For those who wonder if it was fixed over the past 8 years: No, the bug still is the same, no workaround available.

[#2]

schattenfeld at gmail dot com [2007-08-02 07:43:13]

If you want to describe table like DESCRIBE in MySQL you can use this:

$sql = <<

SELECT column_name,data_type,column_default,is_nullable

FROM

information_schema.tables AS t

JOIN

information_schema.columns AS c ON

t.table_catalog=c.table_catalog AND

t.table_schema=c.table_schema AND

t.table_name=c.table_name

WHERE

t.table_name='TABLE-NAME'

SQL;

[#3]

huszti_dot_roland_at_freemail_dot_com [2006-05-11 05:51:05]

For really detailed table information, use syscolumns, like this:

SELECT c.name, c.prec, c.scale, t.name type

FROM syscolumns c, systypes t, sysobjects o

WHERE o.name = 'yourtablename' AND o.id = c.id AND c.xtype = t.xtype

For other properties see the MS SQL online help. Search for 'syscolumns'.

Or an another solution:

sp_columns @table_name = 'yourtablename', @column_name = 'thecolumnname'

//no "select ..." !!!!

This gives info about only the specified column.

[#4]

php_rindern_de [2004-10-25 01:36:17]

commenting Reynard Hilman:

for me it looks like the colstat field value of 1 in syscolumns table indicates an Identity Column.

[#5]

Reynard Hilman [2003-10-22 19:40:05]

If you want to describe table structure (like mysql 'desc table' command), sending this query might help:

$sql="SELECT c.name, c.isnullable, c.length, c.colstat, t.name type

FROM syscolumns c, systypes t, sysobjects o

WHERE o.name = '$table' AND o.id = c.id AND c.xtype = t.xtype";?>

I suspect the colstat field in syscolumns table indicates primary key when its value is 1

[#6]

bmaddy_at_class_dot_umn_dot_edu [2003-04-29 19:41:22]

Be aware that this function will only return the first 30 characters of the name of the column.  If the actual column name is longer, it will be truncated.  This is at least true with the following setup:

PHP 4.3.1

MSSQL 8.00.760

Have a good day everyone!

Brian

[#7]

alonf at spiralsolutions dot com [2002-11-28 02:47:29]

As kubalaa at bigfoot dot com note mssql_fetch_field->column_source return field name instead table name also with MSSQL2000 connection. Be adwised!!!

[#8]

pong at taft dot org [2002-03-15 17:07:46]

When you mssql_fetch_field(int result), you need to do loop to get the name of each field.  Something like:

while($fld = mssql_fetch_field($rs)){

echo $fld->name . "
";

}

I am wondering why we cannot refer it by a field number.

[#9]

skipsey at hotmail dot com [2001-02-08 07:58:53]

It seems fairly hard to get a list of the tables from your database using MSSQL but this seems to do the trick. This is set to get only the User Tables and ignores the sytem tables.

mssql_connect("server","","") or die ("help me!");mssql_select_db("") or die ("Noooo!");$result=mssql_query("sp_tables");$fields=mssql_num_fields($result);$rows=mssql_num_rows($result);

for ($f=0;$f

if($CHKTYPE=='TABLE'){//$name = mssql_fetch_field($result, 2);$field=GetField($result,"TABLE_NAME",$f)."
";

echo$field;

}

}?>

[#10]

kubalaa at bigfoot dot com [2000-04-04 15:58:58]

Using this function with MSSQL 7, $returned->column_source is the column name, not the table name as it should be.

资源下载链接为: https://pan.quark.cn/s/f989b9092fc5 HttpServletRequestWrapper 是 Java Servlet API 中的一个工具类,位于 javax.servlet.http 包中,用于对 HttpServletRequest 对象进行封装,从而在 Web 应用中实现对 HTTP 请求的拦截、修改或增强等功能。通过继承该类并覆盖相关方法,开发者可以轻松地自定义请求处理逻辑,例如修改请求参数、添加请求头、记录日志等。 参数过滤:在请求到达处理器之前,可以对请求参数进行检查或修改,例如去除 URL 编码、过滤敏感信息或进行安全检查。 请求头操作:可以修改或添加请求头,比如设置自定义的 Content-Type 或添加认证信息。 请求属性扩展:在原始请求的基础上添加自定义属性,供后续处理使用。 日志记录:在处理请求前记录请求信息,如 URL、参数、请求头等,便于调试和监控。 跨域支持:通过添加 CORS 相关的响应头,允许来自不同源的请求。 HttpServletRequestWrapper 通过继承 HttpServletRequest 接口并重写其方法来实现功能。开发者可以在重写的方法中添加自定义逻辑,例如在获取参数时进行过滤,或在读取请求体时进行解密。当调用这些方法时,实际上是调用了包装器中的方法,从而实现了对原始请求的修改或增强。 以下是一个简单的示例,展示如何创建一个用于过滤请求参数的包装器: 在 doFilter 方法中,可以使用 CustomRequestWrapper 包装原始请求: 这样,每当调用 getParameterValues 方法时,都会先经过自定义的过滤逻辑。 HttpServletRequestWrapper 是 Java Web 开发中一个强大的工具,它提供了灵活的扩展性,允许开发者
FETCH CST_MWIPLOTSTS_CUR_1 INTO :MWIPLOTSTS_N.LOT_ID, :MWIPLOTSTS_N.LOT_DESC, :MWIPLOTSTS_N.FACTORY, :MWIPLOTSTS_N.MAT_ID, :MWIPLOTSTS_N.MAT_VER, :MWIPLOTSTS_N.FLOW, :MWIPLOTSTS_N.FLOW_SEQ_NUM, :MWIPLOTSTS_N.OPER, :MWIPLOTSTS_N.QTY_1, :MWIPLOTSTS_N.QTY_2, :MWIPLOTSTS_N.QTY_3, :MWIPLOTSTS_N.CRR_ID, :MWIPLOTSTS_N.LOT_TYPE, :MWIPLOTSTS_N.OWNER_CODE, :MWIPLOTSTS_N.CREATE_CODE, :MWIPLOTSTS_N.LOT_PRIORITY, :MWIPLOTSTS_N.LOT_STATUS, :MWIPLOTSTS_N.HOLD_FLAG, :MWIPLOTSTS_N.HOLD_CODE, :MWIPLOTSTS_N.HOLD_PASSWORD, :MWIPLOTSTS_N.HOLD_PRV_GRP_ID, :MWIPLOTSTS_N.OPER_IN_QTY_1, :MWIPLOTSTS_N.OPER_IN_QTY_2, :MWIPLOTSTS_N.OPER_IN_QTY_3, :MWIPLOTSTS_N.CREATE_QTY_1, :MWIPLOTSTS_N.CREATE_QTY_2, :MWIPLOTSTS_N.CREATE_QTY_3, :MWIPLOTSTS_N.START_QTY_1, :MWIPLOTSTS_N.START_QTY_2, :MWIPLOTSTS_N.START_QTY_3, :MWIPLOTSTS_N.INV_FLAG, :MWIPLOTSTS_N.TRANSIT_FLAG, :MWIPLOTSTS_N.UNIT_EXIST_FLAG, :MWIPLOTSTS_N.INV_UNIT, :MWIPLOTSTS_N.RWK_FLAG, :MWIPLOTSTS_N.RWK_CODE, :MWIPLOTSTS_N.RWK_COUNT, :MWIPLOTSTS_N.RWK_RET_FLOW, :MWIPLOTSTS_N.RWK_RET_FLOW_SEQ_NUM, :MWIPLOTSTS_N.RWK_RET_OPER, :MWIPLOTSTS_N.RWK_END_FLOW, :MWIPLOTSTS_N.RWK_END_FLOW_SEQ_NUM, :MWIPLOTSTS_N.RWK_END_OPER, :MWIPLOTSTS_N.RWK_RET_CLEAR_FLAG, :MWIPLOTSTS_N.RWK_TIME, :MWIPLOTSTS_N.NSTD_FLAG, :MWIPLOTSTS_N.NSTD_RET_FLOW, :MWIPLOTSTS_N.NSTD_RET_FLOW_SEQ_NUM, :MWIPLOTSTS_N.NSTD_RET_OPER, :MWIPLOTSTS_N.NSTD_TIME, :MWIPLOTSTS_N.REP_FLAG, :MWIPLOTSTS_N.REP_RET_OPER, :MWIPLOTSTS_N.STR_RET_FLOW, :MWIPLOTSTS_N.STR_RET_FLOW_SEQ_NUM, :MWIPLOTSTS_N.STR_RET_OPER, :MWIPLOTSTS_N.START_FLAG, :MWIPLOTSTS_N.START_TIME, :MWIPLOTSTS_N.START_RES_ID, :MWIPLOTSTS_N.END_FLAG, :MWIPLOTSTS_N.END_TIME, :MWIPLOTSTS_N.END_RES_ID, :MWIPLOTSTS_N.SAMPLE_FLAG, :MWIPLOTSTS_N.SAMPLE_WAIT_FLAG, :MWIPLOTSTS_N.SAMPLE_RESULT, :MWIPLOTSTS_N.FROM_TO_FLAG, :MWIPLOTSTS_N.FROM_TO_LOT_ID, :MWIPLOTSTS_N.SHIP_CODE, :MWIPLOTSTS_N.SHIP_TIME, :MWIPLOTSTS_N.ORG_DUE_TIME, :MWIPLOTSTS_N.SCH_DUE_TIME, :MWIPLOTSTS_N.CREATE_TIME, :MWIPLOTSTS_N.FAC_IN_TIME, :MWIPLOTSTS_N.FLOW_IN_TIME, :MWIPLOTSTS_N.OPER_IN_TIME, :MWIPLOTSTS_N.RESERVE_RES_ID, :MWIPLOTSTS_N.PORT_ID, :MWIPLOTSTS_N.BATCH_ID, :M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TS_N.CRITICAL_RES_ID, :MWIPLOTSTS_N.CRITICAL_RES_GROUP_ID, :MWIPLOTSTS_N.SAVE_RES_ID_1, :MWIPLOTSTS_N.SAVE_RES_ID_2, :MWIPLOTSTS_N.SUBRES_ID, :MWIPLOTSTS_N.LOT_GROUP_ID_1, :MWIPLOTSTS_N.LOT_GROUP_ID_2, :MWIPLOTSTS_N.LOT_GROUP_ID_3, :MWIPLOTSTS_N.YIELD_1, :MWIPLOTSTS_N.YIELD_2, :MWIPLOTSTS_N.YIELD_3, :MWIPLOTSTS_N.GOOD_QTY, :MWIPLOTSTS_N.RESV_FIELD_1, :MWIPLOTSTS_N.RESV_FIELD_2, :MWIPLOTSTS_N.RESV_FIELD_3, :MWIPLOTSTS_N.RESV_FIELD_4, :MWIPLOTSTS_N.RESV_FIELD_5, :MWIPLOTSTS_N.RESV_FLAG_1, :MWIPLOTSTS_N.RESV_FLAG_2, :MWIPLOTSTS_N.RESV_FLAG_3, :MWIPLOTSTS_N.RESV_FLAG_4, :MWIPLOTSTS_N.RESV_FLAG_5; break;
07-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值