SQL Question.

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8413
  • Loc: USA

Post 3+ Months Ago

Does anyone here see a problem with this SQL code?
SQL Code: [ Select ]
UPDATE censite_users SET 'UID' = '', 'username' = 'Bogey', 'email' = <!-- e -->'email@address.com<!-- e -->', 'password' = '4f4adcbf8c6f66dcfc8a3282ac2bf10a', 'name' = 'Some name', 'reg_date' = '1234482654', 'last_visit' = '', 'permission' = '0', 'allow_email' = '', 'style' = '', 'avatar' = '', 'website' = 'http://www.wedevoy.com', 'user_warnings' = '', 'birthdate' = '08/21/1990', 'verified' = '1', 'verifyID' = '', 'secret_question' = 'Who are you?', 'answer_secret_question' = 'I am me' WHERE 'UID' = '2'

The reason I am asking this is because I have the code automatically generate for me...
  • Flanders
  • Beginner
  • Beginner
  • User avatar
  • Posts: 48
  • Loc: Reno, Nevada US

Post 3+ Months Ago

remove the tick marks from the field names...
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8413
  • Loc: USA

Post 3+ Months Ago

Was that really the only problem I had? Awesome! Thanks.
SQL Code: [ Select ]
UPDATE censite_users SET UID = '', username = 'Bogey', email = <!-- e -->'email@address.com<!-- e -->', password = '4f4adcbf8c6f66dcfc8a3282ac2bf10a', name = 'Some name', reg_date = '1234482767', last_visit = '', permission = '0', allow_email = '', style = '', avatar = '', website = 'http://www.wedevoy.com', user_warnings = '', birthdate = '08/21/1990', verified = '1', verifyID = '', secret_question = 'Who are you?', answer_secret_question = 'I am me' WHERE UID = '2'
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

I've never seen a single-quote refered to as a tick before. I for one was immediately confused.

I would say you had single-quotes around your field names which is a syntax error.

If you had been using back-ticks, it wouldn't have been a syntax error. Back-ticks can actually be used as a work around to have table and column names that are made up of MySQL reserved words if I remember right.
  • Flanders
  • Beginner
  • Beginner
  • User avatar
  • Posts: 48
  • Loc: Reno, Nevada US

Post 3+ Months Ago

Sorry for the odd nomenclature, but I think the message got across. I must remember we are an international community. I humbly submit myself for punishment.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 128 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.