<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">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 class="h5">
<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 class="h5">
<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>