想做个电影网站的多条件筛选,要怎么做啊,还有怎么调用到数据库中的数据进先筛选,和显示。。新人求解
是做到这的 http://www.jw20.com/channels/2823.html 万分感谢
6 个解决方案
#1
#2
#3
本质是sql语句
select * from t_movie
where mtype = ?
and region = ?
and mtime = ?
...
你从本质着手,想清楚大致的逻辑,其余语法部分都可以算是小事。
select * from t_movie
where mtype = ?
and region = ?
and mtime = ?
...
你从本质着手,想清楚大致的逻辑,其余语法部分都可以算是小事。
#4
sql.Append("select * from movie");
sql.Append(" where type=@type"); //默认全部
if (model.title != "")
{
sql.Append(" and title like'%'+@title+'%'");
}
if (model.area != "")
{
sql.Append(" and area=@area");
}
if (model.year != "")
{
sql.Append(" and year=@year");
}
sql.Append(" order by hot desc");
#5
select * from 表 where type in('动作','爱情') and country in('大陆','日本') and yeas in('2001','2003')
#6
#1
#2
http://blog.csdn.net/qingyun1029/article/details/6666811
http://download.csdn.net/detail/kucandesign/4742600
自己再改造改造
http://download.csdn.net/detail/kucandesign/4742600
自己再改造改造
#3
本质是sql语句
select * from t_movie
where mtype = ?
and region = ?
and mtime = ?
...
你从本质着手,想清楚大致的逻辑,其余语法部分都可以算是小事。
select * from t_movie
where mtype = ?
and region = ?
and mtime = ?
...
你从本质着手,想清楚大致的逻辑,其余语法部分都可以算是小事。
#4
sql.Append("select * from movie");
sql.Append(" where type=@type"); //默认全部
if (model.title != "")
{
sql.Append(" and title like'%'+@title+'%'");
}
if (model.area != "")
{
sql.Append(" and area=@area");
}
if (model.year != "")
{
sql.Append(" and year=@year");
}
sql.Append(" order by hot desc");
#5
select * from 表 where type in('动作','爱情') and country in('大陆','日本') and yeas in('2001','2003')