jamshaid_0007 Posted January 10, 2013 Share Posted January 10, 2013 i have some records in database... i want to update that records if the records does not exist then new record inserted how?????? Quote Link to comment https://forums.phpfreaks.com/topic/272946-insert-update/ Share on other sites More sharing options...
Christian F. Posted January 10, 2013 Share Posted January 10, 2013 INSERT ... ON DUPLICATE UPDATE ... That's the syntax you're looking for. In other words, opposite of what you described it as, but with the same end result. A Google search for it should provide you with lots and lots of examples, and tutorials, on how to use it. Quote Link to comment https://forums.phpfreaks.com/topic/272946-insert-update/#findComment-1404680 Share on other sites More sharing options...
jamshaid_0007 Posted January 10, 2013 Author Share Posted January 10, 2013 INSERT ... ON DUPLICATE UPDATE ... That's the syntax you're looking for. In other words, opposite of what you described it as, but with the same end result. A Google search for it should provide you with lots and lots of examples, and tutorials, on how to use it. thanku :-) Quote Link to comment https://forums.phpfreaks.com/topic/272946-insert-update/#findComment-1404684 Share on other sites More sharing options...
Christian F. Posted January 10, 2013 Share Posted January 10, 2013 You're welcome. Quote Link to comment https://forums.phpfreaks.com/topic/272946-insert-update/#findComment-1404690 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.