This repository has been archived on 2024-08-28. You can view files and clone it, but cannot push or open issues or pull requests.
satori-services/public/get-profile-field.php

21 lines
619 B
PHP
Raw Normal View History

2022-07-04 00:07:38 +00:00
<?php
require_once '_flashii.php';
$userId = (int)filter_input(INPUT_GET, 'user', FILTER_SANITIZE_NUMBER_INT);
$fieldId = (int)filter_input(INPUT_GET, 'field', FILTER_SANITIZE_NUMBER_INT);
try {
$fetch = $db->prepare('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = :field AND `user_id` = :user');
$fetch->bindValue('user', $userId);
$fetch->bindValue('field', $fieldId);
$fetch->execute();
$data = $fetch->fetchObject();
if($data)
echo json_encode($data);
else {
echo '{"error":105}';
}
} catch(PDOException $ex) {
echo '{"error":104}';
}