# Database constraint violation?

**URL:** https://forum.kirupa.com/t/database-constraint-violation/166814
**Category:** Uncategorized
**Created:** [October 23, 2005, 1:03am UTC](https://forum.kirupa.com/t/database-constraint-violation/166814 "2005-10-23T01:03:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![eyeofthestorm](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@eyeofthestorm](https://forum.kirupa.com/u/eyeofthestorm)
#### Post date: [October 23, 2005, 1:03am UTC](https://forum.kirupa.com/t/database-constraint-violation/166814/1 "2005-10-23T01:03:49Z")

</div>

```php
$q = $db->query('INSERT INTO news (news_id, news_title, news_content, news_date, news_poster) VALUES (?,?,?,?,?)',
				 array($news_id, $news_title, $news_content, $news_date, $news_poster));

```

when i try executing that code in my script i get the error:

“DB Error: Contsraint Violation”

what does this mean? and what can i do to fix it?
