PHP is a server-side scripting language that allows embedding programs into HTML pages. PHP scripts are made up of statements terminated with semicolons that are interpreted by the server before sending the page to the browser. Variables and control structures like loops and conditionals can be used. PHP allows pages to serve multiple purposes like displaying information and tracking site metrics. To connect to a database, a server, username, password, and database name are required. Queries can then retrieve and manipulate data which is returned as an object. Data needs formatting before editing like updating or deleting displayed records.