Jump to content


Photo

insert & update


  • Please log in to reply
3 replies to this topic

#1 jamshaid_0007

jamshaid_0007

    Newbie

  • Members
  • Pip
  • 6 posts
  • LocationLahore punjab Pakistan
  • Age:23

Posted 10 January 2013 - 07:25 AM

i have some records in database... i want to update that records if the records does not exist then new record inserted how??????

#2 Christian F.

Christian F.

    Advanced Member

  • Staff Alumni
  • 3,106 posts
  • LocationNorway

Posted 10 January 2013 - 07:30 AM

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.
Keeping it simple.

#3 jamshaid_0007

jamshaid_0007

    Newbie

  • Members
  • Pip
  • 6 posts
  • LocationLahore punjab Pakistan
  • Age:23

Posted 10 January 2013 - 07:38 AM

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 :-)

#4 Christian F.

Christian F.

    Advanced Member

  • Staff Alumni
  • 3,106 posts
  • LocationNorway

Posted 10 January 2013 - 07:45 AM

You're welcome. :)
Keeping it simple.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com