# Php/mysql autoincrement

**URL:** https://forum.kirupa.com/t/php-mysql-autoincrement/100774
**Category:** Uncategorized
**Created:** [February 2, 2004, 8:38am UTC](https://forum.kirupa.com/t/php-mysql-autoincrement/100774 "2004-02-02T08:38:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sinus\_](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sinus_/32/417_2.png) [@sinus\_](https://forum.kirupa.com/u/sinus_)
#### Post date: [February 2, 2004, 8:38am UTC](https://forum.kirupa.com/t/php-mysql-autoincrement/100774/1 "2004-02-02T08:38:44Z")

</div>

i have a 2 column table in mysql, NEWS\_ID and NEWS\_CONTENT… but when i save something in the database, it is not in order… not 123 but 132465…etc… why???

why is it when i post news, the arranngement is random?

im new to mysql/php…

the code to adding is similar to this:

```php

//execute / add
if(!mysql_query(sprintf($addSt,$HTTP_POST_VARS['content']), $link)){
	DisplayError(sprintf("Error in executing %s statement", $addSt));
	DisplayError(sprintf("error: %d %s", mysql_errno($link), mysql_error($link)));
	exit();
}
else
{
	echo "<center><BR><b>...Yes! Successfully added the entry to $news_table.</b></center>";
}

```

thanks
