I try to save a users "Office-365 ID" in a MySQL database, after a login into my page. But it doesn't work.
<?php
$servername = 'localhost';
$username = 'root';
$password = '';
$db = 'test';
$Office_ID = $_POST['Office_ID'];
$exists = mysqli_query($conn, "SELECT * from users WHERE Office_ID = '$Office_ID'");
$no_of_rows = mysqli_num_rows($exists);
if($no_of_rows == 0)
{
mysqli_query($conn, "INSERT INTO users VALUE ('$Office_ID')");
}
?>
Did i make a mistake?