0 || mysql_num_rows($rsent)>0) { die('{"msg": "There are '.mysql_num_rows($rverb).' verbs and '.mysql_num_rows($rsent).' sentences are connected to this theme.\nPlease, switch off them before deleting this theme!"}'); } else { $r = mysql_query("DELETE FROM pvc_topics WHERE t_id=$t_id"); $r = mysql_query("DELETE FROM pvc_verb_topics WHERE topic_id=$t_id"); $r = mysql_query("DELETE FROM pvc_sentence_topic WHERE topic_id=$t_id"); } } else { $rsent = mysql_query("SELECT * FROM pvc_sentence_tag WHERE tag_id=$t_id"); if (mysql_num_rows($rsent)>0) { die('{"msg": "There are '.mysql_num_rows($rsent).' sentences are connected to this tag.\nPlease, switch off them before deleting this tag!"}'); } else { $r = mysql_query("DELETE FROM pvc_tag WHERE t_id=$t_id"); $r = mysql_query("DELETE FROM pvc_sentence_tag WHERE tag_id=$t_id"); } } print '{"msg": "ok"}'; } elseif (isset($_POST['snt'])) { $rt = mysql_query("SELECT * FROM pvc_tag LEFT JOIN pvc_sentence_tag ON (t_id=tag_id AND sentence_id=".intval($_POST['snt']).") ORDER BY t_name"); while ($topic = mysql_fetch_assoc($rt)) { print "
  • $topic[t_name]". " edit" . " X
  • \n"; } } ?>