SQL 搜索问题

WBOY
Release: 2016-06-23 14:11:00
Original
810 people have browsed it

表明: 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;

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!