--- a/adminer/view.inc.php
+++ b/adminer/view.inc.php
@@ -28,12 +28,15 @@
 	}
 }
 
-page_header(($TABLE != "" ? lang('Alter view') : lang('Create view')), $error, array("table" => $TABLE), $TABLE);
-
 if (!$_POST && $TABLE != "") {
 	$row = view($TABLE);
 	$row["name"] = $TABLE;
+	if (!$error) {
+		$error = $connection->error;
+	}
 }
+
+page_header(($TABLE != "" ? lang('Alter view') : lang('Create view')), $error, array("table" => $TABLE), $TABLE);
 ?>
 
 <form action="" method="post">