News & Blog

Order MySQL Text or Varchar Value Numerically

January 6th, 2013 - Posted by Steve Marks to MySQL, Web Development.
Let us begin by taking the following MySQL table: CREATE TABLE `my_table` ( `my_value` VARCHAR( 255 ) NOT NULL ); And now let’s insert the following values: INSERT INTO `my_table` (`my_value`) VALUES ('1'), ('2'), ('5'), ('5A'), ('10'), ('30'); So we’ve got a simple table with ...

MySQL Table Not Auto Incrementing Past 127

April 12th, 2010 - Posted by Steve Marks to MySQL, Web Development.
When inserting records into a MySQL table that contains an auto-incrementing field you might at some point start receiving the following error: “Duplicate entry ‘127’ for key 1” If this is the case it means the datatype of the field in question is set as ‘tiny...