前端展示(三)
前端的功能第一个是论文的内容展示
其中论文可查询全部
也可按照标题 关键词 摘要 进行查询
其中查询全部直接进行数据库的查询
然后是条件查询
选用多条件模糊查询
其中选用三个查询框
按照输入的内容进行多条件模糊查询
其中查询语句如下
sql = '''select * from paper where title like '%%%%%s%%%%' and abstract like '%%%%%s%%%%' and keywords like '%%%%%s%%%%' and href is not null
''' % (title, abstract, keywords)
在sql语言中模糊查询匹配多个字符是用%
在sql语言加入预编译的写法时会出现他的%和模糊查询的%语义冲突
需要加入%%%进行转义
所以在上述sql语句会出现%%%%%s%%%%
然后实现多条件模糊查询
查询页面如下