<?php
	require_once "../dal/dalBase.php";
	class _findbug extends dalBase {
		public function findbug() {
			$sql = "SHOW DATABASES";
			$dataDB = $this->data->executeRecordset($sql);
			
			foreach ($dataDB as $rowsDB) {
				if ($rowsDB["Database"] !== "information_schema") {
					echo "<b>" . $rowsDB["Database"] . "</b><br />";

					$sql = "SHOW TABLE STATUS FROM `" . $rowsDB["Database"] . "`";
					$dataT = $this->data->executeRecordset($sql);
					
					foreach ($dataT as $rowsT) {
						$sql = "SHOW COLUMNS FROM `" . $rowsT["Name"] . "`";
						$dataC = $this->data->executeRecordset($sql);
						
						foreach ($dataC as $rowsC) {
							$sql = "SELECT * FROM `" . $rowsT["Name"] . "` WHERE `" . $rowsC["Field"] . "` LIKE '%doskx.ga%'";
							$data = $this->data->executeRecordset($sql);
	
							if (count($data) > 0) echo $sql . "<br />[" . $rowsT["Name"] . "][" . $rowsC["Field"] . "]<br />" . PHP_EOL;
							
							if ($rowsT["Name"] == "registry") {
								foreach ($data as $row) {
									echo $dataC[0]["Field"] . " => " . htmlentities($row[$dataC[0]["Field"]]) . "<br />" . PHP_EOL;
									echo $rowsC["Field"] . " => " . htmlentities($row[$rowsC["Field"]]) . "<br />" . PHP_EOL;
									echo "<br /><br />" . PHP_EOL;
								}
							}

							if (count($data) > 0) echo "<br /><br />" . PHP_EOL;
						}
					}
				}
			}
		}
	}

	$page = new _findbug();
	$page->findbug();
?>