Results 1 to 2 of 2

Thread: Need to display pictures stored in database
      
   

  1. #1
    Skipper02 is offline Sergeant
    Join Date
    Jun 2008
    Posts
    25

    Default Need to display pictures stored in database

    I want that visitors to my website be able to upload their own pictures and later display them. While the uploading part seem to work, as the database is getting populated, I am unable to display the pictures. I am using pictures in the jpg format. The code that I am using is:

    <?php
    session_start();
    $userId = $_SESSION['userId'];
    $password = $_SESSION['password'];
    $db_host= "localhost";
    $db_user = "XXXX_YYYY";
    $db_password = "AAAAA";
    $db_name ="XXXX_StudyKitchenData";
    $db = mysql_connect($db_host, $db_user, $db_password);
    mysql_select_db($db_name, $db);
    $sql = "SELECT Email FROM UserDetails WHERE Email = '$userId' AND Password = '$password'";
    $result = mysql_query($sql, $db);
    if(!mysql_num_rows($result)== 1){
    unset($_SESSION['userId'], $_SESSION['password']); // clear bad username/password from session;
    header("location:http://www.studykitchen.com/login.php"); // redirect for them to login again
    }
    $query = "SELECT Picture FROM mypic WHERE Email ='$userId'";
    $result = mysql_query($query, $db);
    while($row = mysql_fetch_array($result, MYSQL_ASSOC))
    {
    //I need code for this part

    }
    mysql_close($db);
    ?>

    Any help will be highly appreciated.

  2. #2
    s4u
    s4u is offline Private
    Join Date
    Jul 2008
    Posts
    1

    Default Re: Need to display pictures stored in database

    thank yuo

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49