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

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

WBOY
Release: 2016-06-13 12:04:47
Original
952 people have browsed it

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 />
Copy after login


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


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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template