MySQL Search and Replace »
I really, really wanted to do a search and replace in MySQL, but I just couldn't find it. Then I did.
update tablename set field = replace(field,'search','replace');
I really, really wanted to do a search and replace in MySQL, but I just couldn't find it. Then I did.
update tablename set field = replace(field,'search','replace');
Just a few minutes ago, a friend asked about displaying a future date on his web site. In this particular example, he wanted the name of the next month. In other words, he'd like the word "October" displayed, since it is currently September. Next month it should change to "November", and so on.
There comes a time every now and then where you need to split up large files. If you have the luxury of those files being split anywhere, you can use something like WinRAR, which will split it up into whatever size you like. If it's good enough for file sharing, it's good enough for you, right?
In the course of working with a project today, I came across some useful information. First, the use of command-line parameters in Perl. All you really have to do is add a space between the program name and the first, and then the first and the second, and so on.
At least in MySQL, all you have to do to return random data from your query is add ORDER BY RAND() to your query, for instance:
SELECT * FROM table ORDER BY RAND() LIMIT 1
This week I've been rather busy working on a number of projects - mostly in languages that I don't typically use (notably Javascript). As such, I found myself digging around for information more than is typical, and came across some gems that helped me out when I was at a standstill.
A number of you have mentioned that you would like to use MT-Moderate, specifically to moderate trackbacks, but are unable to do so because you also use SimpleComments.
Because of the way in which I'm making trackbacks moderated, they will still appear in SimpleComments lists of trackbacks.
Now, thanks to Jayaprakash (JP), those of you using dynamic publishing are now able to get around this limitation.
I was moving a bunch of files from one location to another, and it ended up that a ton of those files had the wrong permissions. Now permissions of 755 will generally work for serving an HTML file, but it should probably be served as 644, and since it wasn't it was bugging me. We've already discussed my neuroses, let's just leave it at that.
I was playing with the database yesterday, and decided that some of my auto-incremented values (id numbers for particular tables, specifically Movable Type's PluginData) were simply getting too high.
Now that you have installed MT-Approval, you may want to take a few more steps to make things work just a little bit better. Unfortunately, if you are using the <$MTCommentFields$> configuration mentioned earlier, you will not currently be able to take advantage of these enhancements. I'm working on it. Please be patient.
MT-Approval requires a comment to be previewed prior to generating the hash field, so you must preview at some point prior to posting. This is not an option. Yes, it is true that you could submit a hash yourself with your post, but you may not be able to get the correct hash, which is the whole point of MT-Approval.
I needed to concatenate some information in a table, and I wanted to do it with a SQL query, but I could not for the life of me figure out how to combine the two strings (one a constant, the other a field name) in order to produce a joined value.
Finally, I found it- concat.
update tablename
set fieldname = 'constant' concat 'fieldname'
I was redesigning the plugin pages to get the documentation into a useful format, and found that I needed an anchor tag so that the reader could jump to a particular place in the document.