# Don't know if should disable AUTO INCREMENT

**URL:** https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651
**Category:** Need Help
**Created:** [August 19, 2021, 2:50pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651 "2021-08-19T14:50:23Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)
#### Post date: [August 19, 2021, 2:50pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/1 "2021-08-19T14:50:23Z")

</div>

When a user adds a bio, the bios id is set equal to the user id. But I am still using AUTO INCREMENT for the bios id in my bios table. Should I turn off AUTO INCREMENT?

---

<div class="post-metadata">

### Author: ![dirk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dirk/32/2174_2.png) [@dirk](https://discourse.cakephp.org/u/dirk)
#### Post date: [August 19, 2021, 3:57pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/2 "2021-08-19T15:57:42Z")

</div>

You should read about Table associations

[https://book.cakephp.org/4/en/orm/associations.html](https://book.cakephp.org/4/en/orm/associations.html)

---

<div class="post-metadata">

### Author: ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)
#### Post date: [August 19, 2021, 7:42pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/3 "2021-08-19T19:42:13Z")

</div>

I hear voices so I can’t read.

---

<div class="post-metadata">

### Author: ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)
#### Post date: [August 19, 2021, 8:33pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/4 "2021-08-19T20:33:24Z")

</div>

I watched a couple of videos but I still don’t know if I should disable AUTO INCREMENT.

---

<div class="post-metadata">

### Author: ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)
#### Post date: [August 19, 2021, 8:36pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/5 "2021-08-19T20:36:47Z")

</div>

Right now I have

```auto
        $this->hasMany('Bios', [
            'foreignKey' => 'user_id',
        ]);

```

in the UsersTable and I think I should change it to hasOne but I’m not sure.

---

<div class="post-metadata">

### Author: ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)
#### Post date: [August 19, 2021, 8:49pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/6 "2021-08-19T20:49:30Z")

</div>

If you’re manually setting the ID field, you should disable auto increment. Also, you should not be manually setting the ID field, you should be creating associations between records in the traditional way.

---

<div class="post-metadata">

### Author: ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)
#### Post date: [August 19, 2021, 10:28pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/7 "2021-08-19T22:28:59Z")

</div>

Thanks, Zuluru. I will try watching a Udemy video about CakePHP.

---

<div class="post-metadata">

### Author: ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)
#### Post date: [August 19, 2021, 11:06pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/8 "2021-08-19T23:06:01Z")

</div>

There’s only one course on Udemy that teaches CakePHP version 4. The rest are for earlier versions of Cake. I can’t understand the instructor in this tutorial because he has a very strong Indian accent.

---

<div class="post-metadata">

### Author: ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)
#### Post date: [August 20, 2021, 12:48am UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/9 "2021-08-20T00:48:34Z")

</div>

Maybe I should watch a video that explains an older version of Cake? I don’t know for sure.

---

<div class="post-metadata">

### Author: ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)
#### Post date: [August 20, 2021, 3:54am UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/10 "2021-08-20T03:54:08Z")

</div>

Definitely don’t waste your time on anything for Cake 1 or 2, they are so much different from 3 that it’ll only make things worse for you.

---

<div class="post-metadata">

### Author: ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)
#### Post date: [August 20, 2021, 1:59pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/11 "2021-08-20T13:59:12Z")

</div>

One of the videos showed that underscores were used for the template names. I don’t know which version uses underscores. I want to watch this video because the presenter spoke good English but I don’t know if it’s version 3 or not.

---

<div class="post-metadata">

### Author: ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)
#### Post date: [August 20, 2021, 2:10pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/12 "2021-08-20T14:10:19Z")

</div>

The Udemy courses were on sale yesterday but the sale is over now and I can’t afford a course any more.

---

<div class="post-metadata">

### Author: ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)
#### Post date: [August 20, 2021, 3:10pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/13 "2021-08-20T15:10:01Z")

</div>

I think all versions use underscores for template names? I wouldn’t trust any video that doesn’t clearly specify what version it’s talking about.

---

<div class="post-metadata">

### Author: ![dirk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dirk/32/2174_2.png) [@dirk](https://discourse.cakephp.org/u/dirk)
#### Post date: [August 21, 2021, 7:58am UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/14 "2021-08-21T07:58:02Z")

</div>

maybe this is helpful for you:

https://www.youtube.com/embed/videoseries?list=PLLo-6h61K2VodB-nC_UMZgruk1DrNVash&wmode=transparent&rel=0&autohide=1&showinfo=1&enablejsapi=1

This guy has a playlist with 50 videos for cake4

---

<div class="post-metadata">

### Author: ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)
#### Post date: [August 25, 2021, 2:31pm UTC](https://discourse.cakephp.org/t/dont-know-if-should-disable-auto-increment/9651/15 "2021-08-25T14:31:40Z")

</div>

Thanks, dirk. I will take a look at his videos. Udemy had a sale and I bought the tutorial from the Indian guy because it’s the only one that uses CakePHP version 4. He’s hard to understand but I will somehow manage.
