The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Update a row in a database
Elize
post Oct 5 2008, 03:21 AM
Post #1





Group: Members
Posts: 4
Joined: 3-October 08
Member No.: 6,802



Hi

I have created a database and can add a new person, but when a person changes a record and presses the update button, how do I update only that record that has been changed?

Can someone please help me.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Oct 5 2008, 07:01 AM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



What database? For (My)SQL it's something like

UPDATE table WHERE person='fred';

but you need to look in the manual.


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Remote DBA
post Jan 23 2009, 08:58 AM
Post #3





Group: Members
Posts: 8
Joined: 23-January 09
Member No.: 7,617



Hi Brian.

Actually any DBMS supports ANSI-92 SQL Standard

which means statements like
UPDATE table_name
SET col_name1 = expression1, col_name2 = expression2, ....
[ WHERE expression ]

UPDATE Employee
SET salary = salary * 1.25
WHERE name = 'Bob'

UPDATE Order
SET id = id + 3, part = 'updpard'
WHERE part LIKE 'PO-%'

will work everywhere...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 03:41 AM