Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5

Thread: Images in MySQL

  1. #1
    Senior Member justlivyalife's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham, UK
    Posts
    2,871
    Member #
    2374
    I have a client login script that I've been working on within this forum.

    What I want to do is to have screenshots of the work, depending upon the user that is logged in. I will have a field in a database table, entitled 'screenshot', and I was wondering if I could actually show the image rather than just a link to it. If so do I need anything extra like the GD Library?
    justlivyalife - The future depends on what we do in the present. (Mahatma Gandhi)
    WDF Resources: WDF Rules
    Non-WDF: JavascriptSource | Dynamic Drive | phpBB | HTML-Kit | Winamp | Download Firefox | Morguefile

  2.  

  3. #2
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    Yes you will need the GD libary to show the image. I am actually currently working on an application that does this.


  4. #3
    Senior Member splufdaddy's Avatar
    Join Date
    Feb 2003
    Location
    Boston, MA
    Posts
    4,488
    Member #
    735
    Another solution would be to store the URL of the screenshot in the database, and have your code print out:
    <img src="databaselink.jpg">

  5. #4
    Senior Member boolean's Avatar
    Join Date
    Jun 2003
    Posts
    161
    Member #
    1615
    do exactly what spluf daddy said. Just store the image name in the database and then once the user is logged in do something like:
    $query="select * from table where user='$user';";
    $result=mysql_query($query);
    $tmp=mysql_fetch_assoc($result);
    then do something like:
    $image=$tmp['image'];
    print "<IMG SRC=\"$image\">";

  6. #5
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,656
    Member #
    1234
    Liked
    137 times
    Yes, store a reference, not the pic. For a picture site I messed around with, I stored the pic #. Then in the php I referenced it like so:

    (picnum).jpg for big pic, (picnum)_small.jpg for small pic, with PHP of course putting in the pic num part.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:01 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com