表明: topweb表中有: ID 和 ADD怎样搜索 某个 ID 下的 ADD 内容
例如:ID(1) ADD(这里是ID1的内容)$add = ("select * ------  id='{$id}'") //这部分什么写?
echo $add;SQLPHP搜索

解决方案 »

  1.   

    说明:制作图片下载连接引用地址:http://localhost/plus/pngadd.php?aid=查询IDdocument.write("<?php
    require_once(dirname(__FILE__)."/../include/common.inc.php");//图获取图片地址
    //$rul = "http://www.baidu.com/img/baidu_jgylogo3.gif";
     //获取图片名称
    //$png = "baidu_jgylogo3.gif";$url = ("select * from topweb -------- aid='{$aid}'"); //这部分不会写
    $png = "";//获取图片名称
    header("Content-Type: application/force-download");
    header('Content-Disposition: attachment; filename="'.$png.'"');
    $img = file_get_contents($url);
    echo $img;?>");
      

  2.   

    $result = mysql_query("select * from topweb where  aid='{$aid}'"); //这部分不会写
    $row=mysql_fetch_assoc($result);
    $url=$row['add'];
    $png = basename($url);//获取图片名称
    header("Content-Type: application/force-download");
    header('Content-Disposition: attachment; filename="'.$png.'"');
    $img = file_get_contents($url);
    echo $img;