【发布时间】:2018-04-10 09:21:38
【问题描述】:
我正在使用此查询连接到数据库 -
myCMD.commandtext = "select customer_reviews.meta_title, customer_reviews.meta_description from customer_reviews 内部加入客户 customer_reviews.customer_id = customers.id where customers.id = ? limit 1" myCMD.Parameters.Append myCMD.CreateParameter("@customerID", adInteger, adParamInput, 10, request("customer")) 设置 myRS = myCMD.execute
然后我有这个代码:
if Not isNULL(myRS("meta_title")) or myRS("meta_title") "" Then page_meta_title = myRS("meta_title") 结束如果
if Not isNULL(myRS("meta_description")) or myRS("meta_description") "" Then page_meta_description = myRS("meta_description") 结束如果
两个字段都有一个字符串值。参数 page_meta_title 填充得很好,但 page_meta_description 总是返回一个空字符串 - 当我知道它不为空时。
查看数据库后,我注意到第一个字段是 varChar 类型,第二个字段是 Text。我将 Text 数据类型更改为 varchar 并且它起作用了,向参数返回了一个值。
如果我的调试正确,Text 类型的字段是否不适用于 isNULL?
【问题讨论】:
-
对不起,我是想写变量page_meta_title而不是参数
标签: mysql vbscript asp-classic