Posts

Showing posts from August, 2025

Short overview on Unit - V

  Unit – V: Establishing a Database Connection and Working With Database 1. Steps to Establish a Connection with Database Definition: Database connection is the process of linking a programming language (like PHP) or software to a database (like MySQL, Oracle, etc.) to perform operations such as inserting, updating, deleting, and retrieving data. Steps: Choose a Database Common databases: MySQL, PostgreSQL, Oracle, SQL Server . Example: For web applications, MySQL is widely used with PHP. Install Database Server Install MySQL Server or use hosted database services. Also install phpMyAdmin for graphical management. Configure Database Create a Database Name (e.g., student_db ). Create a User with a password and grant privileges. Establish Connection in Code (Example in PHP): <?php $servername = "localhost" ; $username = "root" ; $password = "" ; $dbname = "student_db" ; // Create conn...

Short overview on Unit-IV

  📘 Unit–IV: User Data Input through Forms 4a. Steps to Create an Input Form 👉 A form is used to collect input from users and send it to a server for processing. Steps Use <form> tag in HTML to create the form. Define action (where the form data will go) and method (how the data will be sent → GET/POST). Add input fields ( text , email , password , radio , checkbox , etc.). Add a submit button. Process the data in a PHP file. Example <!-- form.html --> < form action = "process.php" method = "post" > Name: < input type = "text" name = "uname" > < br > Email: < input type = "email" name = "uemail" > < br > < input type = "submit" value = "Submit" > </ form > <!-- process.php --> <?php $name = $_POST [ 'uname' ]; $email = $_POST [ 'uemail' ]; echo "Welcome $name , your email is $e...

Short overview on Unit-III

  📘 Unit – III: Working with PHP Arrays and Functions 3a. Steps to Use Different Types of Array in a Given Application 🔹 What is an Array? An array stores multiple values in a single variable. Declared using array() or short syntax [] . Types of Arrays in PHP 1. Indexed Array Elements are stored with numeric indexes (0, 1, 2…). Example: <?php $fruits = array ( "Apple" , "Banana" , "Mango" ); echo $fruits [ 0 ]; // Apple ?> ✅ Steps to use in application: Declare array with values. Access elements by index. Use for or foreach loop to process values. Example (display all fruits): foreach ( $fruits as $f ){ echo $f . "<br>" ; } 2. Associative Array Uses key-value pairs instead of numeric index. Example: <?php $marks = array ( "Jay" => 85 , "Deep" => 90 , "Amit" => 78 ); echo $marks [ "Deep" ]; // 90 ?> ✅ Ste...