使用PHP与MySQL交互

$mysqli = new mysqli(“地址”, “用户名”, “密码”, “表”);
if (mysqli_connect_errno()) {
printf(“Connect failed: %s\n”, mysqli_connect_error());
exit();
}
$mysqli->query(“CREATE TABLE Language LIKE CountryLanguage”);
$mysqli->autocommit(FALSE);
$mysqli->query(“INSERT INTO mcmbasic (name, class, id, tl, ts, ip, host) VALUES (‘$name’, ‘$classes’, ‘$code’, ‘$long’, ‘$short’, ‘$ip’, ‘$os’)”);
$mysqli->commit();
$mysqli->query(“DROP TABLE Language”);
$mysqli->close();
echo “<script> alert(‘成功’); </script>”;