Your question is also ambigous to me.
there are several option i can callup now for you
1. You must run php on server. First, copy your php file to a subfolder under webserver root. then type address of that file from your browser. To get right result your server must know how to handle php file. I think your webserver is not configured for executing php files. If you don't configure your webserver then you will get code that you wrote before as result. So first configure your webserver. I think how to configure webserver, you will get in the book details.
2. I think you have configured your webserver for php files as you get this message "Duplicate entry '1' for key 1". You get the whole code that you typed as result when you run 'createmovie.php' because you may not php code block with php tag <?php ....... ?>.
3. U have successfully executed php code and a database has been created and it has 1 table and at least one row of data. You are trying to insert duplicate data, that's why you get that message.
If these solution is not clear to you, you may chat with me. email@example.com