User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 391,971 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,174 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 399 | Replies: 4
Reply
Join Date: Oct 2006
Posts: 60
Reputation: welbyobeng is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
welbyobeng welbyobeng is offline Offline
Junior Poster in Training

IS it possible

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Posts: 107
Reputation: mwasif is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 13
mwasif mwasif is offline Offline
Junior Poster

Re: IS it possible

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

Re: IS it possible

  #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
UPDATE files SET 
fullthumb = CONCAT('http://k5live.com/thumbs/', thumb);



will this code be ran all the time to always update
Reply With Quote  
Join Date: Dec 2007
Posts: 107
Reputation: mwasif is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 13
mwasif mwasif is offline Offline
Junior Poster

Re: IS it possible

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

Re: IS it possible

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MySQL Marketplace
Thread Tools Display Modes

Other Threads in the MySQL Forum

All times are GMT -4. The time now is 9:22 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC