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

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
chickenyd
Forum Newbie
Posts: 4
Joined: Sun Apr 02, 2006 10:36 pm

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

Post 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?
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Type is the type of mysql table; MyISAM.

No idea why there is an auto_increment outside of the table call though..
User avatar
ambivalent
Forum Contributor
Posts: 173
Joined: Thu Apr 14, 2005 8:58 pm
Location: Toronto, ON

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

well look at that, there's a board just for databases. :roll:
Post Reply