Home  >  Article  >  Backend Development  >  discuz 想在门户首页自定SQL读取数据库信息,该如何操作

discuz 想在门户首页自定SQL读取数据库信息,该如何操作

WBOY
WBOYOriginal
2016-06-13 12:04:47878browse

discuz 想在门户首页自定SQL读取数据库信息,该怎么操作?

<br /><?php<br />$query = DB::query("SELECT * FROM ".DB::table('common_advertisement').";");<br />		while($rs = DB::fetch($query)) {<br />			$code=$rs['code'];<br />		}<br />?><br />


这样写出错,要引入SQL链接语句吗?


------解决方案--------------------
不要加分号;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn