1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
<?php
require('connect.php');
if(isset($_GET['tableId']))
{
$tableId=$_GET['tableId'];
$result = mysql_query('SELECT * FROM tchat__tables_connections WHERE tableId="'.$tableId.'"');
$i=0;
while ($row1 = mysql_fetch_object($result)) {
/* echo $row->userId;
echo ';'.$row->userState;
echo "*";
*/
$userIf =$row1->userId;
$result2= mysql_query("select DISTINCT tchat_users.id,tchat_users.name,tchat_users.username,tchat_community_users.avatar,tchat_users.block,tchat_users.block from tchat_community_users INNER JOIN tchat_users ON tchat_users.id=tchat_community_users.userid WHERE tchat_users.id=".$userIf);
while ($row = mysql_fetch_object($result2)) {
$row->state=$row1->userState;
$arr[]=$row;
}
}
echo json_encode($arr);
}
else{
echo'0';
}
?> |
Partager