How do I insert an Image into and echo tag that is in an images folder?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jason1975
    New Member
    • Jul 2010
    • 3

    #1

    How do I insert an Image into and echo tag that is in an images folder?

    I am fairly new at PHP and need help wit this attached is my code, it pick up that there is an image but doe not display it. your help would bemuch appreciated

    Code:
    <?php
    $conn = mysql_connect('localhost','****','****') or die("Could not do it");
    $rs = mysql_select_db("db name") or die("wheres the DB");
    $sql ="SELECT Model FROM handsets WHERE Brand = 'Brand'";
    $result = mysql_query($sql);
    
    while( $row=mysql_fetch_array($result))
    { 
    $Model = $row['Model'];
    $image = $row['Image'];
    echo "<img src=\"http://bytes.com/images/$image\" width=\"30px\" height=\"100%\" align=\"absmiddle\"><input name=\"Model\" type=\"checkbox\" value='$Model' />$Model<br>";
    }
    ?>
    Last edited by Dormilich; Jul 5 '10, 06:20 AM. Reason: removed passwords
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    if the stored image is the image’s location, is the path correct?

    Comment

    • zorgi
      Recognized Expert Contributor
      • Mar 2008
      • 431

      #3
      Noticed that you are only selecting "Model" from your table:

      Code:
      "SELECT Model FROM handsets WHERE Brand = 'Brand'";

      Comment

      Working...