<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -255,10 +255,11 @@ class ezDB_mysql extends ezDB_Base
 		{
 			$this-&gt;rows_affected = mysql_affected_rows($this-&gt;dbh);
 			$this-&gt;num_rows = $this-&gt;rows_affected;
-						
-			if(mysql_insert_id() &gt; 0)
+			
+			$insert_id = mysql_insert_id($this-&gt;dbh);
+			if($insert_id &gt; 0)
 			{
-				$this-&gt;insert_id = mysql_insert_id($this-&gt;dbh);
+				$this-&gt;insert_id = $insert_id;
 				$is_insert = true;
 			}
 			
@@ -271,23 +272,26 @@ class ezDB_mysql extends ezDB_Base
 			// Take note of column info
 			$i=0;
 			
-			while ($i &lt; mysql_num_fields($this-&gt;result))
-			{
-				$this-&gt;col_info[$i] = mysql_fetch_field($this-&gt;result);
-				$i++;
-			}
-			
-			// Store Query Results
-			$num_rows=0;
-			
-			while($row = mysql_fetch_object($this-&gt;result))
+			if($this-&gt;result)
 			{
-				// Store relults as an objects within main array
-				$this-&gt;last_result[$num_rows] = $row;
-				$num_rows++;
-			}
+				while ($i &lt; mysql_num_fields($this-&gt;result))
+				{
+					$this-&gt;col_info[$i] = mysql_fetch_field($this-&gt;result);
+					$i++;
+				}
+				
+				// Store Query Results
+				$num_rows=0;
+				
+				while($row = mysql_fetch_object($this-&gt;result))
+				{
+					// Store relults as an objects within main array
+					$this-&gt;last_result[$num_rows] = $row;
+					$num_rows++;
+				}
 
-			mysql_free_result($this-&gt;result);
+				mysql_free_result($this-&gt;result);
+			}
 			
 			// Log number of rows the query returned
 			$this-&gt;rows_affected = $num_rows;</diff>
      <filename>ezDB_MySQL.class.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ed6e5cbe05e4e5a53fd167aca04620457a345917</id>
    </parent>
  </parents>
  <author>
    <name>Nabeel Shahzad</name>
    <email>nabeel@myorigin=$mydomain.(none)</email>
  </author>
  <url>http://github.com/nshahzad/ezdb/commit/486447094b4f55864f05930bd45e40b1e64e2a3e</url>
  <id>486447094b4f55864f05930bd45e40b1e64e2a3e</id>
  <committed-date>2009-07-21T07:12:39-07:00</committed-date>
  <authored-date>2009-07-21T07:12:39-07:00</authored-date>
  <message>mysql result bug fix</message>
  <tree>b2b9038a18ae372237616d2e4071c81cfebcc595</tree>
  <committer>
    <name>Nabeel Shahzad</name>
    <email>nabeel@myorigin=$mydomain.(none)</email>
  </committer>
</commit>
