I see what you mean. I don&#39;t believe that is possible. See below (From <a href="http://dev.mysql.com/doc/refman/5.5/en/information-functions.html#function_last-insert-id">http://dev.mysql.com/doc/refman/5.5/en/information-functions.html#function_last-insert-id</a>)<div>
<br></div><div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
If you insert multiple rows using a single INSERT statement, LAST_INSERT_ID() returns the value generated for the first inserted row only. The reason for this is to make it possible to reproduce easily the same INSERT statement against some other server.</blockquote>
<div><br></div><div>What is the matter with doing each insert separately? I doubt it would result in any noticeable performance degradation. It&#39;s definitely the route I would take in this situation.</div><div><br><div class="gmail_quote">
On Wed, Apr 20, 2011 at 8:20 PM, Austin Einter <span dir="ltr">&lt;<a href="mailto:austin.einter@gmail.com">austin.einter@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Carl</div>
<div>Thanks for reply.</div>
<div> </div>
<div>I am writing a set of values (not a single record).</div>
<div>But even, db_last_insert_id(), does a SQL query.</div>
<div> </div>
<div>What I am looking, after INSERT, is it pssoble to get array of inserted records without doing one more query.<br></div>
<div>Regards</div>
<div>Austin<br></div>
<div class="gmail_quote">On Thu, Apr 21, 2011 at 7:43 AM, Carl Wiedemann <span dir="ltr">&lt;<a href="mailto:carl.wiedemann@gmail.com" target="_blank">carl.wiedemann@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">db_fetch_array() shouldn&#39;t be used on an INSERT query. You probably want to use <a href="http://api.drupal.org/api/drupal/includes--database.mysql-common.inc/function/db_last_insert_id/6" target="_blank">http://api.drupal.org/api/drupal/includes--database.mysql-common.inc/function/db_last_insert_id/6</a> instead. 
<div><br></div>
<div>
<div>
<div></div>
<div>
<div>On Wed, Apr 20, 2011 at 6:06 PM, Austin Einter <span dir="ltr">&lt;<a href="mailto:austin.einter@gmail.com" target="_blank">austin.einter@gmail.com</a>&gt;</span> wrote:</div></div></div>
<div>
<div>
<div class="gmail_quote">
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">
<div>
<div></div>
<div>
<div>Hi All</div>
<div>I have a table <em>resubmt_skill_ids, </em>it has two coulmns, skillid (primary key) and skillname (unique key).</div>
<div>I have below code. , </div>
<div> </div>
<div><em>  $query_string = &quot;INSERT INTO resubmt_skill_ids (skillname) VALUES  (&#39;php&#39;), (&#39;sql&#39;)  &quot;  ;<br>  $result = db_query($query_string);<br>  <br>  if($result)<br>  {<br>   while($obj = </em><em><strong>db_fetch_array($result))<br>

</strong>   {</em></div>
<div><em> </em></div>
<div><em>           //DO Other stuff</em></div>
<div> </div>
<div>With this I get the warning:  </div>
<div><font color="#ff0000">warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result, boolean given in C:\MyWeb6.20\wamp\www\livejobs1\includes\database.mysqli.inc on line 151.</font></div>
<div> </div>
<div>As per Drupal documentation db_query should return &quot;A database query result resource, or FALSE if the query was not executed correctly.&quot;</div>
<div>So if($result) condition turns out to be true, can I guess that there will be atleast 1 record in $result.</div>
<div> </div>
<div>I found data is written to table, and want to have newly written data (both skillname and corresponding skillid), can I extract the data from $result, or I need to do one more query to get the newly written data.</div>


<div> </div>
<div>Thanks Austin</div><br></div></div>--<br>[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br></div></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>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br></div></div>