我的代码是:
$query = "SELECT a.hash, a.full, a.partial, a.servers, a.lastupd, b.full, b.partial, b.servers, b.lastupd FROM table1 AS a, table2 AS b WHERE a.hash='".$hashcode."' AND a.hash=b.hash;";
$result = mysql_query($query);
然后我执行一个
print_r(mysql_fetch_array($result));
我得到了这个奇怪的输出:
Array
(
[0] => blah
[hash] => blah
[1] => 1,1,1
[full] => 0,1
[2] => 1,2,1
[partial] => 4,2
[3] => srv1,srv2,srv3
[servers] => srv2,srv3
[4] => 0000-00-00 00:00:00
[lastupd] => 0000-00-00 00:00:00
[5] => 0,1
[6] => 4,2
[7] => srv2,srv3
[8] => 0000-00-00 00:00:00
)
为什么 table 有数据重复b
并且不创建带有键的关联数组a.*
and b.*
?
注意:设置为 0 的时间戳是正确的