title: Using image magick with php to resize an image while fetching from the database
body: <p>In php I have uploaded an image to the database by using php move_uploaded_file function. Now when I am getting the image from the database I am using this code to get the image</p>
  
  <pre><code>$result = mysql_query("SELECT * FROM "._DB_PREFIX_."storeimages WHERE `city_name`='".$_GET['details']."'");
  while($row = mysql_fetch_array($result)){
   echo '&lt;div class="store-img"&gt;';
    echo '&lt;img class="store-image" src="storeimages/images/'.$row['store_image'].'" width="100px" height="100px" &gt;';
    echo '&lt;/div&gt;';
    }
  </code></pre>
  
  <p>Here I am getting the image easily. But here you can see I have used <code>width="100px"</code> and <code>height="100px"</code> for image size. This is disturbing the image aspect ratio. To solve this I have searched over google and I got that <a href="http://www.imagemagick.org/script/index.php" rel="nofollow">imagemagick</a> is a good option for that.But I don't know how to use imagemagick with simple php (I am not using any class, method) and how can I use imagemagick here? Any help and suggestions will be really appreciable. Thanks</p>