<?php
session_start();
if(strpos(strtolower($_SERVER['REQUEST_URI']), 'phpsessid') !== false)
{
  session_destroy();
  session_regenerate_id();
  session_start();
                              
}
include "../phpconfig/config.php";
include "../phpconfig/valida_login.php";


$sql = mysql_query("SELECT id from l_bairros2");

while($lin = mysql_fetch_assoc($sql)){


	$id = $lin['id'];

	mysql_query("DELETE FROM l_bairros WHERE id='$id'");



}

	mysql_query("DELETE FROM l_bairros2");



$sql = mysql_query("SELECT id from empresas2");

while($lin = mysql_fetch_assoc($sql)){


	$id = $lin['id'];

	mysql_query("DELETE FROM empresas WHERE id='$id'");



}


	mysql_query("DELETE FROM empresas2");
	mysql_query("DELETE FROM cadastros");

  
header("location:limpar.php");