php 语句 一个语句的查询结果作为另外个语句的条件!
例如 select * from A where id=1 查询出一个 title 字段的结果 ,然后把这个title 作为条件 供另外个语句 select * from B where dd= $title 类似这样 的 谁能给个具体案例 !
500错误
追答你不会直接粘贴复制了吧,这我也不经常用,大体上是这样的,
$db = M('你的数据表'); 这个一般在MVC中出现,你的要不是MVC的,就用:mysql_connect();
mysql_select_db(); mysql_query() 来链接数据库呗
你没写完整我也不知道该怎么搞
追答select * from B where dd= (select title from A where id=1)如果 1是个参数,
$value=1;
select * from B where dd= (select title from A where id='$value');
Safe Alert: Request Error step 2! 这个错误
追答你把部分源码贴出来
追问Execute('a', $query);
while($row = $dsql->GetArray('a'))
{
?>
语句没问题
你看看http://blog.csdn.net/jodan179/article/details/8021627
输出结果的方式 能写详细点么!搞个完整的案例!
一句sql就好了
追问假如 id=1 是个 参数 该怎么办呢?