Don't Back Down

Posted by Chad Everett on October 20, 2005

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');

Read "MySQL Search and Replace" »

Posted by Chad Everett on September 15, 2005

Date Displays with PHP »

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.

Read "Date Displays with PHP" »

Posted by Chad Everett on July 30, 2005

Splitting Large Files Carefully »

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?

Read "Splitting Large Files Carefully" »

Posted by Chad Everett on July 18, 2005

Little URLs and Parameters »

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.

Read "Little URLs and Parameters" »

Posted by Chad Everett on May 18, 2005

Random Rows in SQL »

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

Read "Random Rows in SQL" »

Posted by Chad Everett on April 30, 2005

A Plethora of Programming »

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.

Read "A Plethora of Programming" »

Posted by Chad Everett on April 12, 2005

MT-Moderate and SimpleComments »

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.

Read "MT-Moderate and SimpleComments" »

Posted by Chad Everett on January 25, 2005

Recursively CHMOD Files »

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.

Read "Recursively CHMOD Files" »

Posted by Chad Everett on January 6, 2005

Updating Auto-Increment in MySQL »

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.

Read "Updating Auto-Increment in MySQL" »

Posted by Chad Everett on December 17, 2004

Enhancing MT-Approval »

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.

Read "Enhancing MT-Approval" »

Posted by Chad Everett on January 6, 2004

AS400 SQL Concatenation »

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'

Read "AS400 SQL Concatenation" »

Posted by Chad Everett on December 26, 2003

Anchors Away! »

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.

Read "Anchors Away!" »