Of course, you can go to phpMyAdmin to browse. But after all, there are omissions. So I wrote a, compare database differences in the script (PHP), to facilitate their own. Of course the code is very simple, do not explain, paste code:
Copy the Code code as follows:
!--? mysql_connect (' localhost ', ' root ', ' root ');
mysql_select_db (' TableA ');//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 be compared
$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 "
Print_r ($e);//Missing Table
Print_r ($f);//Missing table field
?>
The above describes the MySQL time function using MySQL database difference comparison of PHP code, including the use of MySQL time function content, I hope to be interested in PHP tutorial friends helpful.