Is there a mysql query that can pull all of the images out of a table? Haven’t had any luck finding a solution. Thanks
e. from a wordpress site
The images are all in the wp_posts table
In my wp_posts table all of the images are mixed in with other data. I would like to get all of the images out of this table to store on my hard drive
All records from a table
From a specific table
Based on WordPress Database ERD, to get attachments, this should be close
This will give you the attachments as well as the parent post it related to, if you need some sort of context
If I am not mistaken, the
filepath
gives you a link to a disk location where the image files are actually stored. If that is all you want, just browse to it (or ftp if remote) and grab all files from there.I’m not familiar with wordpress but I once had to do a similar thing and solved it via regular expressions.
I do not know a way of doing this directly in the query. I filtered the html code with regular expressions so as to obtain only the img-tags parts. I had to query all posts and then filter them.
I’m assuming you are looking to extract the <img /> tags from the posts?
Otherwise you should provide more info as middaparka already commented.