<?
$result = mysqli_query($link, "SELECT id, name_user, last_name_user FROM users WHERE id_user_vk="123"");
?>
$result = mysqli_query($link, "SELECT ...");
if (mysqli_num_rows($result) == 0) {
mysqli_query($link, "INSERT...");
} else {
// some action
}