22 lines
681 B
PHP
22 lines
681 B
PHP
<?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 {
|
|
http_response_code(404);
|
|
echo '{"error":105}';
|
|
}
|
|
} catch(PDOException $ex) {
|
|
http_response_code(500);
|
|
echo '{"error":104}';
|
|
}
|