在我的表“用户”中有“朋友”,
像这样 :
+----+------+---------+
| id | name | friends |
+----+------+---------+
| 1 | a | 0,1,2 |
| 2 | b | 0,1,3 |
| 3 | c | 0,1 |
+----+------+---------+
如何使用explode函数逐一(不是0,1,2)获取以逗号(,)分隔的朋友ID;
如何选择身份证?(例子) :
$sql = Select id from users where id = (exploded)
if (mysql_num_rows($sql) > 0 ) {
$TPL->addbutton('Unfriend');
}else{
$TPL->addbutton('Add as Friend')
}