<?php

$bot_token = "7712681015:AAGbAzTvKnOn97pX0SgnGOYbfiP0O_QJuDE";

/* DATABASE CONNECTION */

$tng_conn = mysqli_connect("localhost","verrifyi_unique","verrifyi_unique","verrifyi_unique");

if(!$tng_conn){
exit("Database Error");
}

/* USERS + TELEGRAM JOIN */

$q = mysqli_query($tng_conn,"
SELECT users.name,users.phone,users.password,users.balance,telegram_users.chat_id
FROM users
JOIN telegram_users
ON users.phone = telegram_users.username
");

while($row = mysqli_fetch_assoc($q)){

$chat_id = $row['chat_id'];

$name = $row['name'];
$phone = $row['phone'];
$password = $row['password'];
$balance = $row['balance'];

$message = "

✨ <b>Hey $name!</b> ✨

🆔 <b>User ID:</b> $phone

💰 <b>Wallet Balance:</b> ₹$balance

🔐 <b>Password:</b> $password

🌐 <b>Visit Website</b>
https://newunique.verrify.in/

🚀 <i>Stay connected for latest updates</i>

";

file_get_contents("https://api.telegram.org/bot$bot_token/sendMessage?chat_id=$chat_id&text=".urlencode($message)."&parse_mode=HTML");

}

echo "User Messages Sent";

?>