<?php
/*
*To change this license header, choose License Headers in Project Properties.
*To change this template file, choose Tools | Templates
*and open the template in the editor.
*/
require("db_conn.php"); //包含连接文件
$sql="SELECT * FROM 'tb_ad'where isshow=1 order by id desc limit 0,5"; //写查询语句 isshow=1 取五个
$adrs=$db->query($sql); //执行语句 $rs是一个结果集
$adrows=$adrs->fetch_all(MYSQLI_BOTH);  //包括所有行 $adrows有数据库的焦点广告   这一行怎么定义?这一行有错误吗?麻烦各位大神教教我?
require 'index_html.php';
//释放结果集$result->free();//关闭数据库$db->close();

解决方案 »

  1.   

    不明白你的问题什么意思,利用HTML和PHP混编,从数据库把数据读取出来,然后在HTML代码中调取不就可以了,不明白的话可以参考http://www.php.cn/course/type/4.html这里的实战项目,或者在http://www.php.cn/wenda.html这里将你遇到的问题记录下来,会有专业的人员为你解答。