IS it possible

Reply

Join Date: Oct 2006
Posts: 75
Reputation: welbyobeng is an unknown quantity at this point 
Solved Threads: 0
welbyobeng welbyobeng is offline Offline
Junior Poster in Training

IS it possible

 
0
  #1
Mar 10th, 2008
Is it possible to make a column on my database that automatically copy another column on the same table string together with another url?

for example on my database "ewelby_k5" I want to create a new column called (fullthumb) on table "files" where "fullthumb" stores "http://k5live.com/thumbs/ + column "thumb" "

so that I will get http://k5live.com/thumbs/image.jpg on "fullthumb" column
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 191
Reputation: mwasif is an unknown quantity at this point 
Solved Threads: 25
mwasif mwasif is offline Offline
Junior Poster

Re: IS it possible

 
0
  #2
Mar 10th, 2008
Create a column in the table with ALTER TABLE command. Then execute the following query
  1. UPDATE files SET
  2. fullthumb = CONCAT('http://k5live.com/thumbs/', thumb);
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 75
Reputation: welbyobeng is an unknown quantity at this point 
Solved Threads: 0
welbyobeng welbyobeng is offline Offline
Junior Poster in Training

Re: IS it possible

 
0
  #3
Mar 10th, 2008
Originally Posted by mwasif View Post
Create a column in the table with ALTER TABLE command. Then execute the following query
  1. UPDATE files SET
  2. fullthumb = CONCAT('http://k5live.com/thumbs/', thumb);

will this code be ran all the time to always update
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 191
Reputation: mwasif is an unknown quantity at this point 
Solved Threads: 25
mwasif mwasif is offline Offline
Junior Poster

Re: IS it possible

 
0
  #4
Mar 10th, 2008
Or you can create a trigger to UPDATE this for you when a new record is inserted.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 75
Reputation: welbyobeng is an unknown quantity at this point 
Solved Threads: 0
welbyobeng welbyobeng is offline Offline
Junior Poster in Training

Re: IS it possible

 
0
  #5
Mar 10th, 2008
Originally Posted by mwasif View Post
Or you can create a trigger to UPDATE this for you when a new record is inserted.
nice...so how would i create a trigger to by default store "'http://k5live.com/thumbs/" and add thumb to it.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the MySQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC