It is also possible there is another PHP error occurring that is causing the error. It could be that your error reporting level is set to only show warnings.
Add the following code at line 1 of you page to set error reporting to show all errors:
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>
Like Brian said, make sure there are no blank lines or spaces between any of the Closing PHP Blocks "?>" and starting PHP blocks "<?php"
In Dreamweaver, go to View -> Code View Options -> Invisible Elements to force dreamweaver to show spaces and returns, this can make it easier to see if spaces are at the end of any closing php lines.