PHP Require Include Which one To Use?

If you'd have attempted to develop websites using PHP scripting it is common to make use of two major PHP commands namely - include, require. These commands come into play while we create dynamic database driven websites in which connection to mysql database or such databases is stored in a file usually connect.php and this file has to be included in all the scripts that need to connect to database to get things done.
So, what is the exact difference between include and require? In terms of functionality both of them do the same (i.e) to include a file data.
include - If there is an error then it issues a warning and executes subsequent commands
require - It issues an error if something goes wrong and stops the script execution at this point.
It is always recommended to use require instead of include as it is mandatory to terminate script execution if something goes wrong.
PHP Data Insertion Upon Form Submission:
I was working on few PHP websites and wanted to insert information into my database once the form is submitted. I had a dual insertion and every row submitted had duplicates inserted into the database table. I was looking out for ways to fix it and today found a simple fix for the same.Lets say we have an html form that helps us insert username and password into a table in database
Username :
// This is the important part and make a note of name value

Now we have the php script that does this insertion process named as usernameinsert.php. We need to include the following if statement in the php script to go ahead with insertion upon form submission

This simple fix worked great. Try this in your PHP scripts used to create dynamic database driven websites.