�����������
�����
������
������� ��������� �������� VPS - ������� ������ �������� Dedicated server
�������:

VPS - �������:

������ ��������:

Dedicated server:


������ ���������:

������ ����������� ��������

www.megastock.ru

Z-Payment
������ ������
Moneybookers
Payment Network
��������
Contact
�������� ������
MasterCard
VISA
������� CONTACT
�������� �������
��� 24
WIRE USD EURO
������ Z-PAYMENT
SMS ������
��������� ����
��������� ������-�����
��������� ComePay
��������� FreeCash

�����������  �������. �������

�������:










MySQL

3.5.9 AUTO_INCREMENT

3.5.9 AUTO_INCREMENT

AUTO_INCREMENT :

CREATE TABLE animals (id MEDIUMINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL, PRIMARY KEY (id));
INSERT INTO animals (name) VALUES ("dog"),("cat"),("penguin"),
("lax"),("whale");

SELECT * FROM animals;

:

+----+---------+
| id | name    |
+----+---------+
|  1 | dog     |
|  2 | cat     |
|  3 | penguin |
|  4 | lax     |
|  5 | whale   |
+----+---------+

MyISAM BDB AUTO_INCREMENT . , , MAX(auto_increment_column)+1) WHERE prefix=given-prefix. AUTO_INCREMENT , .

CREATE TABLE animals (grp ENUM('fish','mammal','bird') NOT NULL,
             id MEDIUMINT NOT NULL AUTO_INCREMENT
             PRIMARY KEY (grp,id));
INSERT INTO animals (grp,name) VALUES("mammal","dog"),("mammal","cat"),
            ("bird","penguin"),("fish","lax"),("mammal","whale");
SELECT * FROM animals ORDER BY grp,id;

:

+--------+----+---------+
| grp    | id | name    |
+--------+----+---------+
| fish   |  1 | lax     |
| mammal |  1 | dog     |
| mammal |  2 | cat     |
| mammal |  3 | whale   |
| bird   |  1 | penguin |
+--------+----+---------+

, AUTO_INCREMENT , - , AUTO_INCREMENT.

AUTO_INCREMENT, , SQL LAST_INSERT_ID() API mysql_insert_id().






Prime-Hosting.Ru:













Prime-Hosting.Ru:





Copyright 2008-2010
Prime Hosting
Prime Hosting. , VPS - ,  , dedicated serverPrime Hosting. , VPS - , , dedicated server:
VPS - Dedicated server