# Multiple foreign keys?

**URL:** <https://forum.kirupa.com/t/multiple-foreign-keys/195435>\
**Category:** programming\
**Created:** [July 31, 2006, 8:02pm UTC](https://forum.kirupa.com/t/multiple-foreign-keys/195435 "2006-07-31T20:02:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZephyrWest](https://avatars.discourse-cdn.com/v4/letter/z/87869e/32.png) [@ZephyrWest](https://forum.kirupa.com/u/ZephyrWest)\
**Post date:** [July 31, 2006, 8:02pm UTC](https://forum.kirupa.com/t/multiple-foreign-keys/195435/1 "2006-07-31T20:02:36Z")

</div>

In MySQL, when using the InnoDB tables, can there be multiple foreign keys? I tried it but it keeps saying I have a syntax error.

Example:

```auto
CREATE TABLE wp_post2content (
    id INT UNSIGNED NOT NULL auto_increment,
    post_id BIGINT UNSIGNED NOT NULL,
    content_id BIGINT UNSIGNED NOT NULL,
    PRIMARY KEY(id),
    FOREIGN KEY (post_id) REFERENCES wp_posts(ID) ON DELETE CASCADE,
    FOREIGN KEY (content_id) REFERENCES wp_contentdb(id) ON DELETE CASCADE
} TYPE=InnoDB

```
