<?php
include 'confing.php';

$login_input = $_POST['login_input'];

$sql = "SELECT * FROM user_details WHERE email = '$login_input' OR phone = '$login_input'";
$result = mysqli_query($conn, $sql);

if(mysqli_num_rows($result) > 0){
    $row = mysqli_fetch_assoc($result);
    echo json_encode([
        'status' => 'success',
        'id' => $row['id'],
        'phone' => $row['phone']
    ]);
} else {
    echo json_encode(['status' => 'error']);
}
?>
