php html class are corrupted : i'm trying to send an html code to database and then show the code in index.php 
this is what i use to send the html code to DB:    

    $result = "          <li>
                    <a href=$Link class=external item-link item-content>
                      <div class=item-media><img src=$f_image class=lazy lazy-fade-in style=border-radius: 10px; width=42px height=42px></div>
                      <div class=item-inner>
                        <div class=item-title>
                          $Name <span class=test-bull>&bull;</span>
                          <div class=item-footer>$Info</div>
                        </div>
                        <div class=item-after></div>
                      </div>
                    </a>
                  </li>

                  ";

    $sql = "INSERT INTO table1 (test) VALUES ('$result')";

    if ($conn->query($sql) === TRUE) {
        echo "New record created successfully";
    }else {
        echo "Error: " . $sql . "<br>" . $conn->error;
    }

and this is what i use to show the code in index.php:

    <?php

          $sql = "SELECT test FROM table1";
           $result = $conn->query($sql);

     if ($result->num_rows > 0) {
        // output data of each row
         while($row = $result->fetch_assoc()) {
         echo $row ["test"];
     }
     } else {
        echo "0 results";
    }

                  ?>
now as you can see there is more than one class in my html code:

    <a href=$Link class=external item-link item-content>

the problem is when i get the html code from database and show it in index.php the class are corrupted like this:

    <li>
                    <a href="test" class="external" item-link="" item-content="">
                      <div class="item-media"><img src="img/2ff4e.aa.png" class="lazy" lazy-fade-in="" style="border-radius:" 10px;="" width="42px" height="42px"></div>
                      <div class="item-inner">
                        <div class="item-title">
                          test <span class="test-bull">•</span>
                          <div class="item-footer">test</div>
                        </div>
                        <div class="item-after"></div>
                      </div>
                    </a>
                  </li>

what i did wrong? what i have to change/do?

sorry for my english