Mastering Angular Basics In this blog, we will understand the Core Concepts of Angular What is Angular? A framework designed for building client-side using TypeScript It’s used for building dynamic, single-page applications (SPAs) What are single-page applications? It is a web application implementation that loads a single web document and then updates the content of its body as the user interacts with the application. Component It is a fundamental building block of an application. (every Angular application has at least one Root component ). They encapsulate a unit of functionality, including HTML, CSS, and TypeScript logic. app.component.ts : TypeScript file that contains the logic for the root/app component. app.component.html : HTML template file that defines the structure and content of the app component's view. app.component.css : CSS stylesheet file that contains the styles for the app component's appearance. Components are reusable A component includes a Type...
PHP MySQL Connection management AND Database Operations The initial step involves establishing a connection to work with the database in PHP. PHP will therefore need to authenticate itself: we say that it establishes a connection with MySQL. To connect using PDO (PHP Data Objects), we need to instantiate the PDO class, passing the database source (server + database name) and a username and password as parameters to the constructor. Method 1: Using a Function <?php //PDO connexion function Connexion ( ) { $hostname = "localhost" ; $username = "The_name_of_your_user" ; $password = "your_password" ; $databasename = "The_name_of_your_DB" ; try { $conn = new PDO ( "mysql:host= $hostname ;dbname=The_name_of_your_DB" , $username , $password ); // set the PDO error mode to exception $conn -> setAttribute (PDO:: ATTR_ERRMODE , PDO:: ERRMODE_EXCEPTION ); echo "C...