Lets disect this, shall we? Creating an Array [b]$pages = array( 'main' => '[/b] An array with an element 'main' that has literal code for a value [b] include "../inc/config.php"; $query = "SELECT * FROM `thumbs` ORDER BY id DESC"; $result = mysql_query( $query ); if ( !$result ) {[/b] a quote in the literal code we are settign the value of main to, breaking back into script. [b] // replace this with your own error code -- one that doesn't display the query[/b] ... further in the script, a syntax error [b] echo '</tr></table>'; ', // main page[/b] I dont know what you are trying to do here, but i can say one thing: You code is a MESS.