SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2006
    0 Post(s)
    0 Thread(s)

    Question how to get the link out from img src="link" ?

    Hi all,

    Is me again...

    I still have some problem dealing with extracting image to server.

    I wish to extract all images from my database that stored using WYSIWYG to server.

    The data are stored in the format such as record1:

    "This is my book. <br /><img src="book_cover.jpg><br />This is my description of my book............<img src="image2.jpg"><br />...................."

    How can I get the image link out from the records?

    1. book_cover.jpg
    2. image2.jpg

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Philadephia, PA
    1 Post(s)
    0 Thread(s)
    You need to implement this in a programming language, not in SQL. MySQL provides a regular expression matcher, but it can only tell you if the expression has a match, not extract multiple matches out of a string.

    I suggest you do the matching before you put the WYSIWYG HTML into the database, and explicitly store the image names in another table with a foreign key to this table.


Posting Permissions

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