下面是新闻查询代码
'' order by inputtime desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write"暂无推荐图片新闻!"
else
do while not rs.eof
response.write"[url=]
[img][/img]
"
if len(rs("title"))>12 then
response.write""&left(rs("title"),10)&""
else
response.write""&rs("title")&""
end if
response.write"[/url]"
response.write""
rs.movenext
loop
end if
%>
上面的代码能够查询到最新新闻数据,但是连接的文件名确在另外一个表中,应该要怎么样写查询代码呢?才能够使连接地址正常连接?
新闻表
id,Title,Photo
新闻文件名在另外一个表中!比如在B表,字段:xwwj
这样才能够得到那个连接地址中的新闻文件名?
两个表有个相关连的字段:新闻表:channelid B表:channelid
|