<?php
$conn = mysql_connect(“localhost”,”root”,”root”);
if(!$conn)
{
die(‘不能连接数据库’.mysql_error());
}
mysql_select_db(“tea”,$conn);
$result = mysql_query(“select g.goods_id from ecs_goods_attr as t,ecs_goods as g where t.attr_value=’国内'”);
//多表查询
while($row = mysql_fetch_array($result))
{
echo $row[‘goods_id’];
echo ‘<br>………..’;
}
mysql_close($conn);
?>
http://bbs.blueidea.com/thread-2925686-1-1.html