0DayMusic.Net Board | 0DayReleases

FAQ Search Memberlist Usergroups

 0DayMusic.Net Board Forum Index

   ProfileProfile    Log in to check your private messagesLog in to check your private messages    GalleriesGalleries    Log inLog in    RegisterRegister 

MYSQL - How to use UPDATE with IF-ELSE condition

 
Post new topic   Reply to topic    0DayMusic.Net Board Forum Index -> 0daymp3.net Informations
View previous topic :: View next topic  
Author Message
gmybft




Joined: 30 Nov 2010
Posts: 1
Read: 0 topics

Warns: 0/5

PostPosted: Tue 4:41, 30 Nov 2010    Post subject: MYSQL - How to use UPDATE with IF-ELSE condition

 

I have three columns - id, programname, status

I wanted to use UPDATE with IF condition something like this:


UPDATE elec_products
IF(programname ='Argos')
(
SET status = 1
)
ELSEIF(programname ='sify')
(
SET status = 2
)
ELSE
(
SET status = 3
)
ENDIF
WHERE programname IS NOT NULL


I am not sure if it'll be possible. Please suggest the best possible ways to do this.
Thank you


The post has been approved 0 times
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    0DayMusic.Net Board Forum Index -> 0daymp3.net Informations All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 


fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB © 2001, 2002 phpBB Group

 

Style Created Freely By