Page 1 of 1

wot does this mean: TYPE=MyISAM AUTO_INCREMENT=58 ;

Posted: Sat Apr 22, 2006 4:07 pm
by chickenyd
hi am tring to build a shopping cart table when i came accross this:
CREATE TABLE `tblcart` (
`ct_id` int(10) unsigned NOT NULL auto_increment,
`pd_id` int(10) unsigned NOT NULL default '0',
`ct_qty` mediumint(8) unsigned NOT NULL default '1',
`ct_session_id` char(32) NOT NULL default '',
`ct_date` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`ct_id`),
KEY `pd_id` (`pd_id`),
KEY `ct_session_id` (`ct_session_id`)
) TYPE=MyISAM AUTO_INCREMENT=58 ;



I dont understaand this bit: TYPE=MyISAM AUTO_INCREMENT=58 ;


any suggestions?

Posted: Sat Apr 22, 2006 4:41 pm
by d3ad1ysp0rk
Type is the type of mysql table; MyISAM.

No idea why there is an auto_increment outside of the table call though..

Posted: Sat Apr 22, 2006 4:52 pm
by ambivalent

Code: Select all

To start with an AUTO_INCREMENT value other than 1, you can set that value with CREATE TABLE or ALTER TABLE, like this:

mysql> ALTER TABLE tbl AUTO_INCREMENT = 100;
http://dev.mysql.com/doc/refman/5.0/en/ ... ement.html

Posted: Sat Apr 22, 2006 5:08 pm
by feyd
well look at that, there's a board just for databases. :roll: