Basic string searching in MySQL table columns
Last weekend, I ended up doing a spot of file structure reorganisation on the web server for www.johnhennessy.co.uk and needed to correct some file pointers in entries on my outdoors blog. Rather than grabbing a plugin from somewhere, I decided to edit the posts table directly. First, I needed to select the affected observations and this is where I needed to pick out the affected rows and edit them in MySQL Query Browser. To do that, I needed basic string searching so I opened up my MySQL eBook from Apress and constructed something like the following:
select * from posts_table where post_text like ‘%some_text%’;
The % wildcard characters are needed to pick out a search string in any part of a piece of text. There may be more sophisticated method but this did what I needed in a quick and dirty manner without further ado. Well, it was what I needed.
Other Posts That May Interest You
Place your comment
Topics Discussed
Adobe Apache Blogging Blogs Canon Command Line CSS Debian Fedora Firefox GNOME Google Hard Drives Hardware HTML Installation Internet Explorer Linux Microsoft MySQL Opera Operating System Perl Photoshop Photoshop Elements PHP Plugins SAS Software SQL Ubuntu UNIX upgrade VirtualBox Virtualisation Virtual Machines VMware Web Browsers Windows Windows Vista Windows XP WordPress WordPress.com WordPress plugins XHTMLTwitter Updates
- GR Shared Items: Donncha: Easy Setup for WP Super Cache - One of the things that has bugged me about the WP Super Ca... http://ow.ly/18UbjE 5 hrs ago
- GR Shared Items: SD, SDHC and SDXC cards get speed injection http://ow.ly/18UbjF 5 hrs ago
- GR Shared Items: WP Blackberry: WordPress for BlackBerry 1.4.3 Released http://ow.ly/18UbjG 5 hrs ago
- Not before time: RT @pc_pro: Orange and T-Mobile to share networks from next month http://bit.ly/bhdXsu (Ah, bless) 1 day ago
- GR Shared Items: In Depth: How to make your website mobile compatible http://ow.ly/18Sthe 2 days ago
- More updates...
Monthly Archives
[...] Basic string searching in MySQL table columns [...]