Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
fsib
/
accountOpening-v2
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php header('Content-Type: application/json'); // Database configuration $host = 'localhost'; // Your database host $dbname = 'fsibplc_account_opening'; // Your database name $username = 'root'; // Your database username $password = ''; // Your database password try { // Create a new PDO instance $pdo = new PDO("mysql:host=$host;dbname=$dbname", $username, $password); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Prepare and execute the query $stmt = $pdo->prepare("SELECT * FROM `account_info` WHERE `status` IS NULL ORDER BY `id` ASC;"); $stmt->execute(); // Fetch all applicants $applicants = $stmt->fetchAll(PDO::FETCH_ASSOC); // Return the data as JSON echo json_encode($applicants); } catch (PDOException $e) { echo json_encode(['error' => $e->getMessage()]); } ?>