Forum Moderators: open

Message Too Old, No Replies

PHPmyAdmin

         

tonynoriega

6:02 pm on Aug 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have the basic PHPmyAdmin MYSQL administration screen...

have a table with about 50 fields....

one of those fields is the "agent name"...and one of our agents has left....

instead of manually changing the name of our gone associate to another, is there a way to change them all in one shot?

ceestand

6:25 pm on Aug 2, 2007 (gmt 0)

10+ Year Member



Do you mean something like:

UPDATE Table A
SET agent_name = "new agent"
WHERE agent_name = "old agent"

?

tonynoriega

6:32 pm on Aug 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



?...i dont know...

is that the proper syntax....?
im very new to MySQL....

i will get into the admin section and give it a try and let you know...

much appreciated!
KORN ROCKS!

ceestand

6:59 pm on Aug 2, 2007 (gmt 0)

10+ Year Member



It's definitely not correct syntax.

UPDATE table
SET agent_name = 'new agent'
WHERE agent_name = 'old agent';

The above will update every record in the table "table" where the string value in the column "agent_name" is "old agent" to the value "new agent"

You'll definitely want to learn some basic SQL if you'll be handling a database.

tonynoriega

8:25 pm on Aug 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, that worked....

i did update every record from old agent to new agent, and that was my objective...

thanks