Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    little php image help

    <?php
    $con = mysql_connect("localhost","USERNAME","PASWORD");
    $db = mysql_select_db("maftystu_mafty",$con);
    $sql = "SELECT * FROM `newest work` ORDER BY `id` DESC LIMIT 1";
    $result = mysql_query($sql) or die("Error: ".mysql_error());
    while($row = mysql_fetch_array($result)){
    echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
    echo "<tr> ";
    echo "<td colspan='9'align='center'><a href='$row[1]'target='_blank'><img>$row[2]</img></a></td>";
    echo "</tr>";
    echo "</table>";
    }
    ?>

    i have my real username and pass in the real one of course, but something is going wrong, and i dont know if its in the php code im putting in dreamweaver, or if its something i did on mySQL. the file extensions i used for my icon image were

    ../jpegs/abstractspikesPOTM.jpg for the icon and

    ../jpegs/abstractspikes.jpg for the full image to be showed in a new browser window.

    which part am i messing up, you can see my problem here at
    www.maftystudios.com
    in the bottom right you can see were im trying to put my php. hopefully someone can help me

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    To show an image in html, you use <img src="path/to/file"> not <img>path/to/file</img>

  • #3
    New Coder
    Join Date
    Mar 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah thank you, worked


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •