Of course you can go to phpMyAdmin to browse. But after all, there are omissions. So I wrote a comparison of database differences in the script (PHP), to facilitate their own. Of course, the code is very simple, do not explain, paste code:
Copy Code code as follows:
?
mysql_connect (' localhost ', ' root ', ' root ');
mysql_select_db (' TableA '); The standard database
$q = mysql_query ("Show Tables");
while ($s = mysql_fetch_array ($q)) {
$name = $s [0];
$q 1 = mysql_query ("desc $name");
while ($s 1 = mysql_fetch_array ($q 1)) {
$a [$name] = $s 1[0];
}
}
Mysql_close ();
mysql_connect (' localhost ', ' root ', ' root ');
mysql_select_db (' TableB ');/database to compare
$q 2 = mysql_query ("Show Tables");
while ($s 2 = mysql_fetch_array ($q 2)) {
$name 2= $s 2[0];
$q 3 = mysql_query ("desc $name 2");
while ($s 3 = mysql_fetch_array ($q 3)) {
$AA [$name 2][] = $s 3[0];
}
}
Mysql_close ();
$f = $e = Array ();
$str = $fuhao = ';
foreach ($a as $k => $v) {
if (!is_array ($aa [$k])) {
$e [] = $k;
}
else{
If Count ($aa [$k]) <> count ($v)) {
foreach ($v as $k 1=> $v 1) {
if (!in_array ($v 1, $aa [$k])) {
$f [$k] = $v 1;
}
}
}
}
}
echo "<pre>";
Print_r ($e);//Missing table
Print_r ($f);//Missing table fields
?>