<?php
$this->db = db_connect();
$conn=mysqli_connect(DB_HOST,DB_USERNAME,DB_PASS,DB_NAME);

$show_tb = $this->db->query($conn,"SHOW TABLES FROM ".DB_NAME);

while($fetch_tb = mysqli_fetch_array($show_tb))
{
	$show_col = $this->db->query($conn,"show columns from ".$fetch_tb[0]."");echo "<br>";
	while($fetch_col = mysqli_fetch_array($show_col))
	{
		if($fetch_col[4]=="" && $fetch_col[5]=="")
		{
			$this->db->query($conn,"ALTER TABLE `$fetch_tb[0]` CHANGE ".$fetch_col[0]." ".$fetch_col[0]." ".$fetch_col[1]." NULL");
		}
	}
}

$this->db->query($conn,"update site_controls set site_value='1' where settings_name='user' and site_key='changenull'");
?>
