Results 1 to 2 of 2

Thread: How can I Display a image stored in mySQL?

  1. #1
    Join Date
    Mar 2008
    Posts
    1

    Default How can I Display a image stored in mySQL?

    Is it fine stoering the image file in mySQL database and acessing it.
    And how can i display the image on my HTML page accessing ny image stored in mySQL database??
    please reply.
    Powered by Yahoo!

  2. #2
    Join Date
    Mar 2008
    Posts
    1

    Default

    You could also use some very basic PHP.

    <?php

    $conn = mysql_connect(dbhost, dbuser, dbpass) or die ('Unable to connect to database');
    mysql_select_db(whatever_you_db_is);

    $query = "SELECT * FROM tablename";
    $result = mysql_query($query);

    while($row = mysql_fetch_array($result, MYSQL_ASSOC))
    {
    echo "<img src={$row['image']}>";
    }

    ?>
    Powered by Yahoo!

Tags for this Thread

Bookmarks

Posting Permissions

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