Re: Replace, Substitute, Delete

2007-05-09 Thread Scott Haneda
> Instead of individual replacements, as in ... > > SELECT REPLACE('De Long', ' ', ''); > > would this global approach work? > > SELECT REPLACE(imgName,' ','') FROM staff WHERE imgName REGEXP ' '; I just used that as an example. What you are doing is fine, you put the field name in the first ar

Re: Replace, Substitute, Delete

2007-05-09 Thread Scott Haneda
> (1) I thought it might be quicker than Perl or PHP. Correct me if I'm wrong. > > (2) I have read a short description of Triggers, and I thought these > three lines of code might be an excellent AFTER INSERT trigger. (I > don't know enough about Triggers yet to know if they'll even take multiple

Re: Replace, Substitute, Delete

2007-05-09 Thread John Kebbel
Instead of individual replacements, as in ... SELECT REPLACE('De Long', ' ', ''); would this global approach work? SELECT REPLACE(imgName,' ','') FROM staff WHERE imgName REGEXP ' '; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: Replace, Substitute, Delete

2007-05-09 Thread John Kebbel
John Meyer wrote ... "you may want to do a perl script to find and replace the spaces." Scott Haneda wrote ... "I would move your html and string parse logic into php," If I'm doing data entry for individuals via a web page, Javascript is a third option.

Re: Replace, Substitute, Delete

2007-05-09 Thread John Meyer
John Kebbel wrote: > For years, I've been using FileMaker Pro to generate a staff photo > gallery and staff phone directory from the same table of staff > information. I'm switching to PHP/MySQL for the year ahead. In STEP 1 > below, I concatenate a name for the teacher/staff person image and

Re: Replace, Substitute, Delete

2007-05-09 Thread Scott Haneda
> > STEP 1: Create the root of the image name > update staff set imgName = Lower(CONCAT(Left(last,6),Left(first,2))); > > STEP 2: > How do I delete spaces in the imgName? > > STEP 3: > update staff set webLine = CONCAT(" width='100' height='125'>",first," ",last,""); > > Thanks in advance for