热搜:NVER node 开发 php

SQL 搜索问题

2024-09-13 11:25:01
SQL 搜索问题

表明: topweb

表中有: ID 和 ADD

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


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

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


回复讨论(解决方案)

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

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


要结果

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

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




说明:制作图片下载连接

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

document.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;

?>");



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