The Little Guy Posted September 14, 2008 Share Posted September 14, 2008 How can I do a regular expression? I have tried this: SELECT * FROM `stats` WHERE REGEXP '^http://phpsnips.com*' but, I get an error. Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted September 14, 2008 Share Posted September 14, 2008 You need to specify the column on which to perform the Regular Expression on. SELECT * FROM `stats` WHERE `field` REGEXP '^http://phpsnips.com*' Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted September 14, 2008 Author Share Posted September 14, 2008 OK Figured it out! Question... How can I take this: SELECT * FROM `stats` WHERE `currentLocation` REGEXP '^http://phpsnips.com*' so it says "where currentLocation !=" what is in the REGEXP? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted September 14, 2008 Share Posted September 14, 2008 Try this: SELECT * FROM `stats` WHERE `currentLocation` REGEXP '[^http://phpsnips.com]' Why don't you just use != ? Here is a good reference for MySQL Regex. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted September 14, 2008 Author Share Posted September 14, 2008 Thanks, looks like it worked! I was looking at that like b4 Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted September 14, 2008 Author Share Posted September 14, 2008 Just kidding, doesn't look like it worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.