嵌套查询很慢,怎么办?
<P>$query = "SELECT * FROM test1";<BR>$result = mysql_query($query);<BR>while ($data = mysql_fetch_assoc($result)) { <BR> $query1 = "SELECT * FROM test2 WHERE id = " . $data['id']; <BR> $result1 = mysql_query($query1);<BR> while ($data1 = mysql_fetch_assoc($result1)) { </P><P><BR> }</P>
<P>}</P>
<P>我现在的程序需要用到像这样的多数据表的查询,但像上面一样写出来的程序太慢了,谁有比较快的查询方法?<BR>谢谢</P>
页:
[1]
