Heim  >  Artikel  >  Backend-Entwicklung  >  SQL 搜索问题

SQL 搜索问题

WBOY
WBOYOriginal
2016-06-23 14:11:00805Durchsuche

表明: topweb

表中有: ID 和 ADD

怎样搜索 某个 ID 下的 ADD 内容


例如:ID(1) ADD(这里是ID1的内容)

$add = ("select * ------  id='{$id}'") //这部分什么写?
echo $add;


回复讨论(解决方案)

递归查询?
贴记录及要求结果出来看看

递归查询?
贴记录及要求结果出来看看


要结果

贴记录及要求结果出来看看

贴记录及要求结果出来看看




说明:制作图片下载连接

引用地址:http://localhost/plus/pngadd.php?aid=查询ID

document.write(" 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;

?>");



$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;

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn