items table ID column

by jaym, Monday, July 14, 2014, 16:40 (3632 days ago)

Hi, Just wondering... shouldn't then field ID in the items table be autoincrement?

In my items table it's not...
+-----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| id | int(11) | NO | | 0 | |
| datetime | datetime | NO | | NULL | |
| title | text | NO | | NULL | |
| content | longtext | NO | | NULL | |

...and in my table of 15000 items...

mysql> SELECT COUNT(id) from items where id=0;
+-----------+
| COUNT(id) |
+-----------+
| 8960 |
+-----------+

...more than half have ID=0. This isn't very helpful if I want to use this field as a foreign key.

Anyone else have this issue? Perhaps my db setup is incorrect?

Thanks!


Complete thread:

 RSS Feed of thread

powered by my little forum