Jump to content


Photo

Inserting data into a specific part of a row]


  • Please log in to reply
2 replies to this topic

#1 DrAwesomePhD

DrAwesomePhD
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 23 February 2006 - 07:42 PM

Hi, i'm sure this is a really stupid question, but could anyone please tell me the command to insert data into a certain part of the table? It seems my command that i've used before is being tempermental :-/

I'm trying to change the value of my account (charname=Jeht member_id = 1) in the access field to 15 from null. I've tried this:

INSERT INTO members (access) VALUES ('15') WHERE charname = 'Jeht';

and its not happy with the "WHERE" part of it .... anyone plz help? and sorry for my noobness :-/

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 23 February 2006 - 07:54 PM

Think update, not insert -- the row is already there!

Try the following:

UPDATE members SET access = '15' WHERE charname = 'Jeht';

Make sense?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 DrAwesomePhD

DrAwesomePhD
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 23 February 2006 - 10:06 PM

Ah thanks so much. So INSERT must be for new rows only.... thanks ^_^ good to know.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users