Month: March 2022

PDO Connectivity Step 4

4. Update Data <?php // include database connection file include_once 'dbconfig.php'; $database = new Connection(); $db = $database->openConnection(); if (isset($_POST['upd'])) { // Get the userid $userid =...
READ MORE   >>

PDO Connectivity Step 3

3. Read Data - Index File <?php include_once 'dbconfig.php'; try { $database = new Connection(); $db = $database->openConnection(); //echo "Connection created successfully"; $database->closeConnection(); } catch (PDOException...
READ MORE   >>

PDO Connectivity Step 2

2. Insert Data <?php // include database connection file include_once 'dbconfig.php'; $database = new Connection(); $db = $database->openConnection(); if (isset($_POST['insert'])) { // Posted Values $name = $_POST['name']; ...
READ MORE   >>

PDO Connectivity Step 1

DB Config File <?php Class Connection { private $server = "mysql:host=localhost;dbname=pdo"; private $user = "root"; private $pass = ""; private $options = array(PDO::ATTR_ERRMODE =>...
READ MORE   >>

Recent Comments

    • Copyright © 2020 (Er. Shairy Kalra). All Rights Reserved