Professional Web Applications Themes

how to store image links in mysql - PHP Programming

Hi I want to develop a dynamic gallery but can not find an example that targets someone of my limited intelligence. If someone out there can show me a line from phpmyadmin which references an image in a seperate folder. The database I am envisaging will hold references to thumbnails as well as well as related information. and then be dynamically sent to an html file. I am still getting to grips with the data types etc so any pointers would be gratefully appreciated. thanking you steve...

  1. #1

    Default how to store image links in mysql

    Hi I want to develop a dynamic gallery but can not find an example that
    targets someone of my limited intelligence.

    If someone out there can show me a line from phpmyadmin which references an
    image in a seperate folder.


    The database I am envisaging will hold references to thumbnails as well as
    well as related information. and then be dynamically sent to an html file.

    I am still getting to grips with the data types etc so any pointers would be
    gratefully appreciated.

    thanking you

    steve


    ACAY Guest

  2. #2

    Default Re: how to store image links in mysql



    On 12-Jan-2004, "ACAY" <kakotamaya2001@hotmail.com> wrote:
    > Hi I want to develop a dynamic gallery but can not find an example that
    > targets someone of my limited intelligence.
    >
    > If someone out there can show me a line from phpmyadmin which references
    > an
    > image in a seperate folder.
    >
    >
    > The database I am envisaging will hold references to thumbnails as well
    > as
    > well as related information. and then be dynamically sent to an html file.
    The usual practice is to store the path to the image file in the table as a
    varchar(255) or text field. When you want to display the image (to the
    client) just slap the path in the src= parm of an <img tag.



    --
    Tom Thackrey
    [url]www.creative-light.com[/url]
    tom (at) creative (dash) light (dot) com
    do NOT send email to [email]jamesbutler@willglen.net[/email] (it's reserved for spammers)

    Tom Thackrey Guest

  3. #3

    Default Re: how to store image links in mysql


    "ACAY" <kakotamaya2001@hotmail.com> wrote
    > Hi I want to develop a dynamic gallery but can not find an example that
    > targets someone of my limited intelligence.
    [...]
    > I am still getting to grips with the data types etc so any pointers would
    be
    > gratefully appreciated.
    The type of Text will hold Strings up to 64k characters (for whole paths).
    You have to ensure the files stay intact (like being unchanged and
    existing).

    Carl


    Carl Melot Guest

  4. #4

    Default Re: how to store image links in mysql

    I`ve got a question almost similar tot this....how do you upload your image
    to a remote host and put it in the database
    so noot every user has to upload images...

    "Carl Melot" <camelot@linkwave.org> schreef in bericht
    news:bu06k5$95h$06$1@news.t-online.com...
    >
    > "ACAY" <kakotamaya2001@hotmail.com> wrote
    >
    > > Hi I want to develop a dynamic gallery but can not find an example that
    > > targets someone of my limited intelligence.
    > [...]
    > > I am still getting to grips with the data types etc so any pointers
    would
    > be
    > > gratefully appreciated.
    >
    > The type of Text will hold Strings up to 64k characters (for whole paths).
    > You have to ensure the files stay intact (like being unchanged and
    > existing).
    >
    > Carl
    >
    >

    Robert Guest

  5. #5

    Default Re: how to store image links in mysql


    On 13-Jan-2004, "Robert" <mad3@hotmail.com> wrote:
    > I`ve got a question almost similar tot this....how do you upload your
    > image
    > to a remote host and put it in the database
    > so noot every user has to upload images...
    To learn more about file uploads:
    [url]http://www.php.net/manual/en/features.file-upload.php[/url]

    If you really want to store images in a table, define a colum as a blob type
    probably longblob. Upload the file, open it, read the contents, escape the
    special characters with mysql_escape_string(), and insert them into the
    table.

    When you want to serve the image. Write a php page that does so and
    reference it in your <img tag like:
    <img src="myimageserver.php?imagid=12345">

    myimageserver.php will have to output the appropriate headers followed by
    the contents of the longblob column in the table. Something like:

    header("Content-Type: image/jpeg\n");
    header("Content-Transfer-Encoding: binary");
    echo $row['imageblob'];


    --
    Tom Thackrey
    [url]www.creative-light.com[/url]
    tom (at) creative (dash) light (dot) com
    do NOT send email to [email]jamesbutler@willglen.net[/email] (it's reserved for spammers)
    Tom Thackrey Guest

  6. #6

    Default Re: how to store image links in mysql

    thanks for that info and feedback.

    So mysql can store ... // etc with no escaping?

    finally, do you think that relative links are better and am i right in
    thinking the links should be relative from the page they are inserted into
    and ignore where mysql is?

    Does anyone have a table scema that I can look at?

    Can anyone suggest a good book or tutorial that implements a gallery driven
    by php and mysql?


    Thanks very much again

    steve

    "ACAY" <kakotamaya2001@hotmail.com> wrote in message
    news:40036016@news.rivernet.com.au...
    > Hi I want to develop a dynamic gallery but can not find an example that
    > targets someone of my limited intelligence.
    >
    > If someone out there can show me a line from phpmyadmin which references
    an
    > image in a seperate folder.
    >
    >
    > The database I am envisaging will hold references to thumbnails as well
    as
    > well as related information. and then be dynamically sent to an html file.
    >
    > I am still getting to grips with the data types etc so any pointers would
    be
    > gratefully appreciated.
    >
    > thanking you
    >
    > steve
    >
    >

    ACAY Guest

Similar Threads

  1. image links
    By jeggs in forum Macromedia Dynamic HTML
    Replies: 3
    Last Post: August 17th, 06:37 PM
  2. PHP/MySQL links with hidden URL?
    By ticasticus in forum Dreamweaver AppDev
    Replies: 1
    Last Post: April 30th, 10:33 AM
  3. Active links from 1st image on 2nd image
    By Colin Polyps in forum Macromedia Flash
    Replies: 4
    Last Post: August 12th, 09:42 AM
  4. determine image information on image stored in MySQL BLOB
    By kristofl in forum PHP Development
    Replies: 2
    Last Post: October 4th, 01:22 PM
  5. When we move Image Links and HTML links
    By Gil in forum HTML & CSS
    Replies: 0
    Last Post: July 29th, 03:12 PM

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
  •  

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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139