mariadb "$db" -N -B -q -e "select \`id\` from contact c where \"$b\" not in (select \`contact-id\` from group_member) and (c.baseurl = \"$b\" or c.url = \"$b\")"| sudo tee -a "$idsdownfile"&> /dev/null
}
loop_3(){
echo"Deleting user $lineb"
mariadb "$db" -N -B -q -e "delete from \`contact\` where \`id\` = $lineb"
mariadb "$db" -N -B -q -e "delete from \`post-thread\` where \`author-id\` = $lineb or \`causer-id\` = $lineb or \`owner-id\` = $lineb"
mariadb "$db" -N -B -q -e "delete from \`post-thread-user\` where \`author-id\` = $lineb or \`causer-id\` = $lineb or \`owner-id\` = $lineb"
mariadb "$db" -N -B -q -e "delete from \`post-user\` where \`author-id\` = $lineb or \`causer-id\` = $lineb or \`owner-id\` = $lineb"
mariadb "$db" -N -B -q -e "delete from \`post-tag\` where cid = $lineb"
mariadb "$db" -N -B -q -e "delete from \`post\` where \`owner-id\` = $lineb or \`author-id\` = $lineb or \`causer-id\` = $lineb"
mariadb "$db" -N -B -q -e "delete from \`photo\` where \`contact-id\` = $lineb"
mariadb "$db" -N -B -q -e "delete from \`contact\` where \`id\` = $lineb"