显示网页中突出显示的记录的匹配列
我正在尝试使用 CGI 和 postgres 数据库创建基于网络的电话簿搜索。我的选择查询是:
(select * from tel_dir
where
name ~* '$var1' or
city ~* '$var1' or
state ~* '$var1' or
telno ~* '$var1')
INTERSECT
(select * from tel_dir
where
name ~* '$var2' or
city ~* '$var2' or
state ~* '$var2' or
telno ~* '$var2');
连同执行上述查询后获得的结果集,如何获取 $var1 或 $var2 匹配的第一个列名称在获得的每一行中,这样我就可以显示网页中突出显示的列值。
I'am trying to create a web based telephone directory search using CGI and postgres database.My select query is:
(select * from tel_dir
where
name ~* '$var1' or
city ~* '$var1' or
state ~* '$var1' or
telno ~* '$var1')
INTERSECT
(select * from tel_dir
where
name ~* '$var2' or
city ~* '$var2' or
state ~* '$var2' or
telno ~* '$var2');
Along with the result set obtained after executing the above query,how to get the first column name against which $var1 or $var2 matches in each row obtained.so that I can show that column value highlighted in the web page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从你的问题来看并不太清楚,但假设你可以比较
你的css的两个值(我将作为php来执行此操作)...
在显示结果的网页中...(您将需要引用php或与页面顶部的第一个代码示例类似,您将在其中显示其工作结果)
It's not too clear from your question but assuming you can compare the two values (I'll do this as php)
for your css...
in your web page where the results are display... (you will need to reference the php or similar as the first code example in the top of the page where you are displaying the results for this to work)