Results 1 to 2 of 2
  1. #1

    string manipulation in mysql

    i was wondering if there is an efficient way to return a string that is file-name safe through mysql. I know i could use the replace function a million times on a string, but that would not be efficient. maybe something similar to php's preg_replace.

    What im trying to do here is take the title of a page (for example "bgzees Home Page") and turn it into a string that could be used in a unix file system. (formatted to bgzees_home_page).

  2. #2
    Join Date
    Jul 2005
    Just add another column. If you use the same column and do a whitespace replacement, you'll run into situations where you want to change the title but not the filename, or you'll change the title, the filename.. and then have to update all of your links. It will probably be *faster* to add an additional column and yank the data out during the same select than it will be to run a (compiled or not) regex on each returned tuple.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts