<?php
$pdo = new PDO('mysql:host=localhost;dbname=constra_db', 'root', '');
$stmt = $pdo->query("SELECT profile_pic FROM users WHERE email = 'rajesh@constra.com'");
echo "Profile pic path: " . $stmt->fetchColumn() . PHP_EOL;

// Update existing records to remove 'public/' prefix if present
$stmt = $pdo->prepare("UPDATE users SET profile_pic = REPLACE(profile_pic, 'public/', '') WHERE profile_pic LIKE 'public/%'");
$stmt->execute();
echo "Updated " . $stmt->rowCount() . " records." . PHP_EOL;
