PHP无需连接即可获取数据
问题描述:
可以从2个不同的表中获取数据而不加入吗?
例如:我有2个表table1和table2,两者都有名字字段。现在我想要获取两个表的完整记录。
i使用以下查询但不起作用
is that possible to fetch data from 2 different tables without join ??
for ex: i have 2 tables table1 and table2 and both have name field. now i want to fetch complete record of both table.
i use following query but its not work
$fetch = mysql_query("select * from table1,table2");
while ($row = mysql_fetch_array($fetch))
{
echo $row['name'].table1;
echo $row['name'].table2;
}
但不起作用:( ...你可以帮助我。
but its not work :(... can u plz help me.
答
fetch = mysql_query( select * from table1,table2);
while (
fetch = mysql_query("select * from table1,table2"); while (
row = mysql_fetch_array(
row = mysql_fetch_array(
fetch))
{
echo