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 in
STEP 3 I concatenate
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(tdimg src='images/,imgName,.jpg'
width='100' height='125'br clear='all' /,first,
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 in
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.
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:
(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
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 argument