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

20 lines
674 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` = ? AND `user_id` = ?');
$fetch->addParameter(1, $fieldId);
$fetch->addParameter(2, $userId);
2022-07-04 00:07:38 +00:00
$fetch->execute();
$result = $fetch->getResult();
if($result->next())
echo json_encode(['field_value' => $result->getString(0)]);
else echo '{"error":105}';
} catch(Exception $ex) {
echo json_encode(['error' => 104, 'msg' => $ex->getMessage()]);
2022-07-04 00:07:38 +00:00
}