回声值sql JOIN

时间:2017-01-08 01:55:33

标签: php mysql echo inner-join

如何在以下情况下从数据库中获取php的值:

mysql_query("SELECT * FROM user 
INNER JOIN phone p1 ON user.IDPhone1 = p1.ID 
INNER JOIN phone p2 ON user.IDPhone2 = p2.ID )

表电话的列:id,number,operator,model ......

如何从表格电话获取每个用户值“数字”

尝试:

echo $r['p1.number']
echo $r['p2.number']

echo $r['user.IDPhone1.number']
echo $r['user.IDPhone2.number']

还有很多人:x

0 个答案:

没有答案