<?php
ini_set('display_errors', 1);

$linkDb = new mysqli("localhost","homepage_su","01think00","homepage_digital_night");
$linkDb->set_charset("utf8");
$result = $linkDb->query('SELECT id, first_name, last_name FROM users WHERE id > 765');

if ($result) {
	while($user = $result->fetch_object()){
			$token_source = $user->id.$user->first_name.$user->last_name."<br>";
			$update_query = "UPDATE users SET token = MD5('".$token_source."') WHERE id = ".$user->id;
			if ($linkDb->query($update_query)) {
				echo "User ".$user->id." is successfully updated - ".$update_query."<br>";	
			} else {
				echo "User ".$user->id." is not updated - ".$update_query."<br>";	
			}
	}
}

$result->close();
unset($user);