21 lines
619 B
PHP
21 lines
619 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 {
|
||
|
echo '{"error":105}';
|
||
|
}
|
||
|
} catch(PDOException $ex) {
|
||
|
echo '{"error":104}';
|
||
|
}
|