PDO::ERRMODE_EXCEPTION] ); // Prepare and execute query with parameterized statement $stmt = $pdo->prepare("SELECT id, client, company, email, address FROM client_records WHERE modx_user_id = ? ORDER BY client ASC"); $stmt->execute([$userId]); $clients = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { // TODO: Proper error logging and user-friendly error display error_log("Database error in clientDetailsForm: " . $e->getMessage()); $clients = []; } ?>
Choose an existing client to auto-fill the form below.