我做了一个后台,然后我想让他在前台显示东西,就是类似于商品展示,上面是大类 然后下面的标题我想让他加上连接怎么只读取数据库中的这条信息的最新内容显示在前台类似这样,但是我只是想让他显示一条
 <?php  
  $sql="select * from p_video order by id DESC limit 1 ";
  $query=$db->query($sql);
  while($row2=$db->fetch_array($query)){
  ?>
<div class="newspicleft"><a href="video_show.php?id=<?php echo $row2[id]?>">

解决方案 »

  1.   

    查询每个部门工资前两名的通用sqlselect deptno, ename, sal   
    from emp e1  
    where   
       (select count(1)  
       from emp e2  
       where e2.deptno=e1.deptno and e2.ename!=e1.ename and e2.sal>e1.sal)  
       <2  
    order by deptno, sal desc;  
      

  2.   

    [
    code=SQL]
     $sql="select * top 1 from p_video order by id DESC limit 1 ";
    [/code]