Maven4Champ
Technical User
- Jun 16, 2004
- 154
Greetings,
First let me explain my setup and then I will get to the question at hand.
Table: tbl_wiigames
(stores information about games for the Nintendo Wii including 1 game_cover image, 1 game_title, 1 game_id and 3 somewhat unecessary columns that are all used to do 1 simple task.
My task is this.
First populate field1 with the following string:
'
Second, strip out the ' ' in my game_title and replace with '+' and store in field2.
Third, populate field3 with field1 then concatenate field1 and field 2 to equal:
-------------------------------------------------------
I want to be able to do this in some sort of trigger or whatever that only requires 1 field (field3) in my database. Thus I can eleminate field1 and field2. Furthermore, I need this procedure to occur anytime a record is added or modified (on update maybe?) and insert the value into the field3 column for each game_id.
What is the best way of achieving these results? Functions? Stored Procs? Trigers?
I am in MySQL 4 so until my host upgrades, I think triggers are out of the question.
Let me know.
Thanks!
First let me explain my setup and then I will get to the question at hand.
Table: tbl_wiigames
(stores information about games for the Nintendo Wii including 1 game_cover image, 1 game_title, 1 game_id and 3 somewhat unecessary columns that are all used to do 1 simple task.
My task is this.
First populate field1 with the following string:
'
Second, strip out the ' ' in my game_title and replace with '+' and store in field2.
Third, populate field3 with field1 then concatenate field1 and field 2 to equal:
-------------------------------------------------------
I want to be able to do this in some sort of trigger or whatever that only requires 1 field (field3) in my database. Thus I can eleminate field1 and field2. Furthermore, I need this procedure to occur anytime a record is added or modified (on update maybe?) and insert the value into the field3 column for each game_id.
What is the best way of achieving these results? Functions? Stored Procs? Trigers?
I am in MySQL 4 so until my host upgrades, I think triggers are out of the question.
Let me know.
Thanks!