Thread: Mysql Introduction [easy]

View Single Post

  #2 (permalink)  

Old 03-11-2005, 05:49 PM

Users should be aware that when setting COLUMN to equal VALUE, if VALUE is not numeric, it have one apostrophe on both sides. If VALUE is numeric, apostrophes are not required.

Hence,
Code:
UPDATE tutorial SET name="<a href=\"http://www.visualdesigncore.com\">Yes</a>" WHERE id=1;
Is fine. If you were to set id to equal VALUE, and have it text, the following is proper format:
Code:
UPDATE tutorial SET name="<a href=\"http://www.visualdesigncore.com\">Yes</a>" WHERE id='VALUE';
Now since id is set to auto_increment, perhaps it is not the best example. But remember, to either use apostrophes or quotations on either side of a non-numeric value, much like what is used when setting the column name.

Code:
UPDATE tutorial SET name="<a href=\"http://www.visualdesigncore.com\">Yes</a>" WHERE id=1;
[ reply ]
borednerd

borednerd is offline registered.

borednerd's Avatar

Join Date: Feb 2005

Posts: 31