diff --git a/web/zm_html_view_state.php b/web/zm_html_view_state.php
index 26aaa21c4..dd448a936 100644
--- a/web/zm_html_view_state.php
+++ b/web/zm_html_view_state.php
@@ -28,6 +28,7 @@ $running = daemonCheck();
$result = mysql_query( "select * from States" );
if ( !$result )
die( mysql_error() );
+$states = array();
while( $state = mysql_fetch_assoc( $result ) )
{
$states[] = $state;