Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8973101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:22:22+00:00 2026-06-15T18:22:22+00:00

I have a column in a MYSQL table that accepts TEXT which has HTML

  • 0

I have a column in a MYSQL table that accepts TEXT which has HTML tags. Now I want to find all the URLs that have .png/.jpg in the HTML img src attribute.

For example:

Table name: mdl_course_sections; Column name: Summary; Data type of Summary: TEXT

Sample record:

Summary
----------    
<table border="0">
<tbody>
<tr>
<td><img style="display: block; margin-left: auto; margin-right: auto;" src="http://xyz.au/abc.png" height="64" width="64" /></a></td>
<td> Learn about video slideshows.</td>
</tr>
<tr>
<td><img src="http://i1325.photobucket.com/albums/u630/teststudplane/plane-2.jpg" height="95" width="100" /></td>
<td> Explore how video can reinvent education.</td>
</tr>
</table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:22:23+00:00Added an answer on June 15, 2026 at 6:22 pm

    You are going to struggle to do this inside SQL itself. Don’t try, you’ll end up pulling your hair out.

    Instead, go through each of the entries, use an HTML parser to extract the src attribute of each img tag, and process from there.

    The built-in loadHTML method of the DOMDocument class may help, but it can be rather sensitive to poorly-formed HTML. You could also try something like Simple HTML DOM, which lets you use CSS-like selectors, kind of like how jQuery works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL table that has a column called title which is a
I have mysql table that has a column that stores xml as a string.
I have a mySQL table that has a column like this: ID ----- 0352
I have a mysql table that has 2 columns - Column 1 contains a
Lets say I have a table in MySQL called articles, that has a column
I have a column in mysql table that has the the data type INT(11).
In my MySQL table, I have a column of TEXT type. On my HTML
I have a mysql table that has a column that stores dates but isn't
I have a column in a mysql table which has extra whitespaces on the
I have a MySQL table that has about 30k records, of which 2k I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.