fallenangel1983 Posted March 30, 2008 Share Posted March 30, 2008 hey guys. just wondering is there a way to update multiple columns in a table in one query? e.g. i need to update date time and description all at the same time. im assuming its something like UPDATE tablename SET DATE ='$newdate' etc etc butim not sure how to word it. would appreciate any help Quote Link to comment https://forums.phpfreaks.com/topic/98663-updating-multiple-columns/ Share on other sites More sharing options...
mwasif Posted March 30, 2008 Share Posted March 30, 2008 Yes, you can. UPDATE tablename SET DATE ='$newdate', description = '$new_desc' WHERE id=1 This will update both date and description where id=1. You can add as many field as you can and table has them :-) Quote Link to comment https://forums.phpfreaks.com/topic/98663-updating-multiple-columns/#findComment-504938 Share on other sites More sharing options...
fallenangel1983 Posted March 30, 2008 Author Share Posted March 30, 2008 worked fine. thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/98663-updating-multiple-columns/#findComment-504947 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.