public function get_notify_data() { // OBTENEMOS LOS COMENTARIOS NUEVOS!!!!! extract($_POST); //$id_user_writer , $id_user_otherside , $limit_msg_chat $QUERY = "SELECT user.username , user.user_pic , chat.msg , ( FROM_UNIXTIME(chat.fecha ) ) as fecha \nfrom chat , user , notify\n\nWHERE (chat.id_chat = notify.id_chat and id_user_writer = {$id_user_otherside} and user.id_user = id_user_writer and chat.id_user_reader={$writtr_})\n\n\tand notify.notified = 0\n"; $response = mysql_query($QUERY, Conectar::con()); while ($parse = mysql_fetch_assoc($response)) { $DATA[] = $parse; } if (isset($DATA)) { echo json_encode(array('response' => $DATA)); // si hay datos regresamos las notificaciones!!! notify::delete_notify($id_user_otherside, $writtr_); } else { $response = array('response' => false); echo json_encode($response); // no regresamos nada!!!! } }