Perad Posted November 30, 2006 Share Posted November 30, 2006 I have this[code]INSERT INTO unc_members (userid, unc_group) VALUES ($id, $group)[/code]What i want to do is check to see there is a there is an existing value for the userid. If there is I want to update the value?Can i do this with SQL? Or have a got to use PHP? Quote Link to comment Share on other sites More sharing options...
kid_drew Posted November 30, 2006 Share Posted November 30, 2006 use the "ON DUPLICATE UPDATE" command.INSERT INTO unc_members (userid, unc_group) VALUES ($id, $group) ON DUPLICATE UPDATE set unc_group = '$group' Quote Link to comment 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.