<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Austin:<div>Look for the&nbsp;AUTO_INCREMENT value. It is settable. Google it.</div><div>I forget the actual sql syntax. I use Navicat to manage my databases and it makes this kind of thing very easy.</div><div>Bill</div><div><br></div><div><div apple-content-edited="true"> <div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; font-size: 12px; "><span class="Apple-style-span" style="font-size: 12px; "><span class="Apple-style-span" style="font-size: 12px; "><span class="Apple-style-span" style="font-size: 12px; ">William A. Prothero</span></span></span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-style-span" style="font-size: 12px; "><a href="http://earthednet.org/">http://earthednet.org/</a></span></p><br class="Apple-interchange-newline"></span></span></span></span><br class="Apple-interchange-newline"></div></span></div> </div><br><div><div>On Mar 28, 2011, at 5:50 PM, Austin Einter wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi David</div> <div>I did that, but the auto-increment field values starts from a high integer value (approx 15594). Then onwards for each row it is incremented by 1.</div> <div>Though I do not see any problem with that (starting from high value), I would have liked the value to start from 0 or 1 and keep incrementing for each row.<br></div> <div>Is there any-way, I can force the value to start from 0 or 1.</div> <div>&nbsp;</div> <div>Best Regards</div> <div>Austin<br></div> <div class="gmail_quote">On Mon, Mar 28, 2011 at 11:42 PM, Metzler, David <span dir="ltr">&lt;<a href="mailto:metzlerd@evergreen.edu">metzlerd@evergreen.edu</a>&gt;</span> wrote:<br> <blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><br>Do not include cid in the insert statement and it should autoincrement for you.<br> <div> <div></div> <div class="h5"><br>-----Original Message-----<br>From: <a href="mailto:support-bounces@drupal.org">support-bounces@drupal.org</a> on behalf of Austin Einter<br>Sent: Mon 3/28/2011 03:04<br>To: <a href="mailto:support@drupal.org">support@drupal.org</a>; <a href="mailto:development@drupal.org">development@drupal.org</a><br> Subject: [support] How to get the auto-increment value<br><br>Hi All<br>I have a table, where 'cid' field is of type "serial".<br><br>Schema declaration is -&gt; &nbsp;*"'cid' =&gt; array('type' =&gt; 'serial', 'unsigned' =&gt;<br> TRUE, 'not null' =&gt; TRUE, ),"*<br><br>Aim is to have an incremented value for it.<br>The code is as below<br><br>*$lastid = 0;<br>&nbsp;for($delta = 0; $delta &lt; $all_companies; $delta++)<br>&nbsp;{<br>&nbsp;$lastid = db_last_insert_id(rs_companies, cid) + 1;<br> &nbsp; &nbsp; &nbsp;db_query(<br>&nbsp; &nbsp;'INSERT INTO {rs_companies} ( cid, uid, prevcompany, joindate,<br>releasedate) '<br>&nbsp; &nbsp; &nbsp;."VALUES (%d, '%d', '%s', '%d', '%d')",<br>&nbsp;$lastid, &nbsp;*<br><br> With this, I find this 'cid' field is not auto incrementing. &nbsp;Any idea,<br>whats the wrong here.<br><br>Best Regards<br>Austin.<br><br></div></div><br>--<br>[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br> </blockquote></div><br> -- <br>[ Drupal support list | <a href="http://lists.drupal.org/">http://lists.drupal.org/</a> ]</blockquote></div><br></div></body></html>