reset autonumber every month in php
<p>how to reset auto_increment in every month in php?</p>

<p>example:<br>
Month of January
001<br>
002<br>
003<br>
.<br>
.<br>
.<br>
020  </p>

<p>Month of February
001<br>
002<br>
003<br>
.<br>
.<br>
.<br>
and so on..</p>

<p>any reply will greatly appreciated..</p>

<p>here is my sample code:</p>

<pre><code>&lt;?
include("config.php");
$result=mysql_query("select id from product order by id desc limit 1");
$lastrow=mysql_fetch_array($result);
$lastrecord=$lastrow + 1;
$date=date("mdY");
$invoiceNumber=$lastrecord."-".$date;

mysql_query("insert into id values('$invoiceNumber')");
?&gt;
</code></pre>
