File:news-details.html
Method:query.scalar(columns,*where,*order)
在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: Named Pipes Provider, error: 40 - 无法打开到 SQL Server 的连接)
数据库执行错误
xmls/news.xmls
...t,$http.get(page,1),page,10);
@content=@listnews.format(@format);
$if(@count==0){
@content=['<div style="color:#FF0000;font-size:12px;height:45px;line-height:45px;text-align:center;">对不起,当前没有数据!</div>'];
@Pager=$empty;
}
$return($empty);
}
//新闻详情
$sub viewNews(){
@querycata=$query(catalog,content);
@querycontent=$query(content,content);
@ContentId=$http.get(id,0);
@CatalogId=$http.get(cid);
@querycata[CatalogId]=@CatalogId;
@AreaId=$shell[AreaId];
@querycata[AreaId]=@AreaId;
@cataname=@querycata.scalar(CatalogName,['CatalogId={*CatalogId} and AreaId={*AreaId}']);
@rowcontent=@querycontent.row(@ContentId);
@Modified=$empty;
$if(@rowcontent<>$null){
@Modified=@rowcontent[Modified];
@Modified=$datetime.format(@Modified,yyyy-MM-dd);
@Click=@rowcontent[Click];
@querycontent[ContentId]=@ContentId;
@querycontent[Click]=(@Click+1);
@querycontent.update();
}
$else{
@rowcontent=$map();
@rowcontent[Title]=无数据;
}
$return($empty);
}
//上一条,下一条
$sub prevnextG(){...