> Hi,
> 
> I'm a novice to MySQL and am currently facing the following difficulty.
> I'm trying to update a table with a row of data the primary key of which is
> an ID which I believe is an auto incrementing serial number.  My first
> question is how to check if this is the case.

Hi Toni

from the command line (or else how are you using mysql?),
type this:

mysql> desc yourTableName;

..which will give you back a description of your table, something like this:

+----------------------------+---------------+------+-----+---------------------+-----------------------------+
| Field                      | Type          | Null | Key | Default             
| Extra                       |
+----------------------------+---------------+------+-----+---------------------+-----------------------------+
| userID                 | mediumint(9)  | NO   | PRI | NULL                | 
auto_increment              |
| firstname                  | varchar(100)  | NO   |     | NULL                
|                             |
| lastname                   | varchar(100)  | NO   |     | NULL                
|                             |
| primaryEmail               | varchar(100)  | NO   |     | NULL                
|                             |
+----------------------------+---------------+------+-----+---------------------+-----------------------------+
4 rows in set (0.00 sec)


See in my case it is telling me that userID is an integer type, a primary key 
(or "has a primary key", however we say that), and that it is set to 
auto_increment.

> 
> Secondly while trying to insert such a row leaving out this column mySql is
> inserting the row at ID 0 (the previous ID's in the table are from 1 to 9),
> but then will not take further inserts.

hmmm...  I am also relative newbie with mysql, but I am guessing this means 
that your ID field is not set to auto_increment.  FIx that, and then test.

-Govinda


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to