新手问题,马上结帐
news_class
class_id 新闻类型
class_name 新闻名字
news
news_id 新闻ID
class_id 新闻类型id (只存储新闻的id)
news_title 新闻标题
news_count 新闻内容
在前台页面中有一个下拉菜单(保存新闻类型)我想根据新闻表里面的类型id 让它显示类型,并且把class_id存储的值选择成默认项
------解决方案--------------------显示新闻列表:
SELECT * FROM news INNER JOIN news_class ON news.class_id=news_class.class_id
显示新闻:
SELECT * FROM news INNER JOIN news_class ON news.class_id=news_class.class_id where ID=(intID)
最常用ASP编辑器。NOTEPAD.exe
------解决方案--------------------ASPEDIT 微软出的ASP编辑器.比较适合..
------解决方案--------------------随意写了个例程 你看看
<%
set rs=server.createobject( "adodb.recordset ")
set rs1=server.createobject( "adodb.recordset ")
rs.open "select * from news ", conn, 1, 1
while not rs.eof
response.write " <select name= 'classname '> "
rs1.open "select * from news_class "
while not rs1.eof
response.write " <option value= ' " & rs1( "class_id ") & " ' "
if rs1( "class_id ")=rs( "class_id ") then response.write " selected= 'selected ' "
response.write "> " & rs1( "class_name ") & " </option> "
rs1.movenext
wend
rs1.close
response.write " </select> "
response.write rs( "news_title ")
rs.movenext
if not rs.eof then response.write " <br> "
wend
rs.close
set rs=nothing
set rs1=nothing
%>
asp编辑器一般没啥要求吧
我是拿到什么就用什么 一般在dreamweaver里打吧
------解决方案--------------------有句笔误
rs1.open "select * from news_class "
改成
rs1.open "select * from news_class ", conn, 1, 1
------解决方案--------------------你可以去源码方面的网站,下一个新闻、博客方面的源码,那里面有asp在线编辑器.