je kunt het resultaat niet afdrukken vanuit mysqli_query, het is mysqli_resource en om de fout te dumpen moet je mysql_error() wijzigen in mysqli_error()
$username = "bob";
$db = mysqli_connect("localhost", "username", "password", "user_data");
$sql1 = "select id from user_information where username='$username'";
$result = mysqli_query($db, $sql1) or die(mysqli_error());
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
echo $row['id'].'<br>';
}