here is my code, all is fine i am able to print the values fetched from the database using a while block. but i am unable to assign the values to another variable.
<?php
     //all the code to connect etc
     while($row=mysql_fetch_array($result)){
         echo "<tr>";
         echo "<td>" . $id++ . "</td>";
         echo "<td>" . $row['firstname'] . "</td>";
         echo "<td>" . $row['lastname'] . "</td>";
         echo "</tr>";
     }
     while($row=mysql_fetch_array($result)){
         $compname=$row['firstname'];
         $contname=$row['lastname'];
         $contmail=$row['email'];
         $cont=$row['domain'];
    }
?>
 
     
     
    