id_chat_room_pribadi; $count = mysql_fetch_object(mysql_query("select IFNULL(count(id_chat_room_pribadi_detail), 0) as hitung FROM chat_room_pribadi_detail WHERE id_chat_room_pribadi = '".$id_chat_room_pengunjung."'")); $newRow = $count->hitung+1; $id_chat_room_pengunjung_detail = $id_chat_room_pengunjung."_".$newRow; mysql_query("INSERT INTO chat_room_pribadi_detail(id_chat_room_pribadi_detail, id_chat_room_pribadi, pesan, email_from, created_date) VALUES ('".$id_chat_room_pengunjung_detail."','".$id_chat_room_pengunjung."','".$pesan."','".$emailf."',now())"); $data_agama2 = mysql_query("select id_chat_room_pribadi FROM chat_room_pribadi WHERE email_author = '".$email."' AND email = '".$emaila."'"); $agama2=mysql_fetch_object($data_agama2); $id_chat_room_pengunjung2 = $agama2->id_chat_room_pribadi; $count2 = mysql_fetch_object(mysql_query("select IFNULL(count(id_chat_room_pribadi_detail), 0) as hitung FROM chat_room_pribadi_detail WHERE id_chat_room_pribadi = '".$id_chat_room_pengunjung2."'")); $newRow2 = $count2->hitung+1; $id_chat_room_pengunjung_detail2 = $id_chat_room_pengunjung2."_".$newRow2; mysql_query("INSERT INTO chat_room_pribadi_detail(id_chat_room_pribadi_detail, id_chat_room_pribadi, pesan, email_from, created_date) VALUES ('".$id_chat_room_pengunjung_detail2."','".$id_chat_room_pengunjung2."','".$pesan."','".$emailf."',now())"); ?> { "tipe" : "2", "id_chat_room_pengunjung": , "id_chat_room_pengunjung2": }