<div>Is there any way to find the maximum number of rows present in a table.</div>
<div>If it is possible, that should solve my problem.</div>
<div> </div>
<div>- Austin<br><br></div>
<div class="gmail_quote">On Mon, Mar 28, 2011 at 4:29 PM, Austin Einter <span dir="ltr">&lt;<a href="mailto:austin.einter@gmail.com">austin.einter@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>Thanks Nancy.</div>
<div>Do you mean that in my code I should not put the value for &quot;cid&quot;. That means $lastid (in red) should be removed.</div>
<div> </div>
<div> </div>
<div>
<div class="im">
<div style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><em>$lastid = 0;<br>  for($delta = 0; $delta &lt; $all_companies; $delta++)<br>  {<br> $lastid = db_last_insert_id(rs_companies, cid) + 1;<br>
      db_query(<br>    &#39;INSERT INTO {rs_companies} ( cid, uid, prevcompany, joindate, releasedate) &#39;<br>      .&quot;VALUES (%d, &#39;%d&#39;, &#39;%s&#39;, &#39;%d&#39;, &#39;%d&#39;)&quot;, <br><font color="#cc0000"> $lastid, </font> </em></div>
</div>
<div style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><em>$user-&gt;uid</em></div></div>
<div><br> </div>
<div>Regards</div>
<div>Austin<font color="#888888"><br></font></div>
<div>
<div></div>
<div class="h5">
<div class="gmail_quote">On Mon, Mar 28, 2011 at 4:20 PM, nan wich <span dir="ltr">&lt;<a href="mailto:nan_wich@bellsouth.net" target="_blank">nan_wich@bellsouth.net</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 12pt">
<div></div>
<div>You don&#39;t need to provide the value for an auto increment field. &quot;Db_last_insert_id()&quot; is how you get the value <strong>after</strong> the insert, if you need it at all.<br> </div>
<p><font color="#ff007f" size="4" face="bookman old style, new york, times, serif"><em><strong>Nancy</strong></em></font></p>
<p> </p>
<p><font face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</font></p>
<div><br></div>
<div style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 12pt"><br><font size="2" face="Tahoma">
<div style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<hr size="1">
</div>
<div style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><b><span style="FONT-WEIGHT: bold">From:</span></b> Austin Einter</div>
<div style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"></div></font> </div>
<div>
<div style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">I have a table, where &#39;cid&#39; field is of type &quot;serial&quot;.</div>
<div style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"> </div></div>
<div>
<div style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><em>$lastid = 0;<br>  for($delta = 0; $delta &lt; $all_companies; $delta++)<br>  {<br> $lastid = db_last_insert_id(rs_companies, cid) + 1;<br>
      db_query(<br>    &#39;INSERT INTO {rs_companies} ( cid, uid, prevcompany, joindate, releasedate) &#39;<br>      .&quot;VALUES (%d, &#39;%d&#39;, &#39;%s&#39;, &#39;%d&#39;, &#39;%d&#39;)&quot;, <br> $lastid,  </em></div>

<div style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"> </div>
<div style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"> </div></div></div></div></blockquote></div><br></div></div></blockquote></div><br>