<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Krai/Struct/Dbquery/Select.php</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -52,11 +52,12 @@ abstract class Krai_Db_Handler
    *
    * This function executes a specified SQL query using the passed parameters.
    *
+   * @param string $querytype The type of query that is to be executed (one of &quot;select&quot;,&quot;insert&quot;,&quot;update&quot;,&quot;delete&quot;,&quot;transaction&quot; -- use &quot;select&quot; for things like DESCRIBE)
    * @param string $sql The query to execute
    * @param array $params Parameters for the query
    * @return mixed
    */
-  abstract public function Query($sql, array $params = array());
+  abstract public function Query($querytype, $sql, array $params = array());
 
   /**
    * Fetch a database record from a query as an object
@@ -97,7 +98,7 @@ abstract class Krai_Db_Handler
    * @param Krai_Db_Query $qid The query
    * @return integer The number of rows (-1 for an error)
    */
-  abstract public function Rows(Krai_Db_Query $qid);
+  //abstract public function Rows(Krai_Db_Query $qid);
 
   /**
    * Get the error from a query
@@ -107,7 +108,7 @@ abstract class Krai_Db_Handler
    * @param Krai_Db_Query $qid The query
    * @param string $ret The error format
    */
-  abstract public function Error(Krai_Db_Query $qid, $ret);
+  //abstract public function Error(Krai_Db_Query $qid, $ret);
 
   /**
    * Return the number of rows affected by the last query
@@ -116,7 +117,7 @@ abstract class Krai_Db_Handler
    *
    * @param Krai_Db_Query $qid The query
    */
-  abstract public function Affected(Krai_Db_Query $qid);
+  //abstract public function Affected(Krai_Db_Query $qid);
 
   /**
    * Return the last inserted id
@@ -125,7 +126,7 @@ abstract class Krai_Db_Handler
    *
    * @param Krai_Db_Query $qid The query
    */
-  abstract public function Inserted(Krai_Db_Query $qid);
+  //abstract public function Inserted(Krai_Db_Query $qid);
 
   /**
    * Process a query struct according to its type.
@@ -204,13 +205,13 @@ abstract class Krai_Db_Handler
    * @param mixed $tables
    * @return Krai_Struct_Dbquery_Find
    */
-  final public function FindQuery($tables)
+  final public function SelectQuery($tables)
   {
     if(!is_array($tables))
     {
       $tables = array($tables);
     }
-    return new Krai_Struct_Dbquery_Find($tables);
+    return new Krai_Struct_Dbquery_Select($tables);
   }
 
   /**</diff>
      <filename>Krai/Db/Handler.php</filename>
    </modified>
    <modified>
      <diff>@@ -50,9 +50,9 @@ class Krai_Db_Handler_Mysql extends Krai_Db_Handler
   {
     switch($query-&gt;action)
     {
-      case &quot;find&quot;:
+      case &quot;select&quot;:
         $sql = &quot;SELECT &quot;.((count($query-&gt;fields) &gt; 0) ? implode(&quot;, &quot;, $query-&gt;fields) : &quot;*&quot;).&quot; FROM &quot;.$this-&gt;GetJoins($query-&gt;tables).(($query-&gt;conditions != &quot;&quot;) ? &quot; WHERE &quot;.$query-&gt;conditions : &quot;&quot;).(($query-&gt;order != &quot;&quot;) ? &quot; ORDER BY &quot;. $query-&gt;order : &quot;&quot;).(($query-&gt;limit != &quot;&quot;) ? &quot; LIMIT &quot;.$query-&gt;limit : &quot;&quot;);
-        $q = $this-&gt;Query($sql, $query-&gt;parameters);
+        $q = $this-&gt;Query(&quot;select&quot;, $sql, $query-&gt;parameters);
 
         if($query-&gt;limit != &quot;1&quot;)
         {
@@ -70,15 +70,7 @@ class Krai_Db_Handler_Mysql extends Krai_Db_Handler
         break;
       case &quot;delete&quot;:
         $sql = &quot;DELETE FROM &quot;.$this-&gt;GetJoins($query-&gt;tables).(($query-&gt;conditions != &quot;&quot;) ? &quot; WHERE &quot;.$query-&gt;conditions : &quot;&quot;).(($query-&gt;limit != &quot;&quot;) ? &quot; LIMIT &quot;.$query-&gt;limit : &quot;&quot;);
-        $res = $this-&gt;Query($sql, $query-&gt;parameters);
-        if($res instanceOf Krai_Db_Query)
-        {
-          return $this-&gt;Affected($res);
-        }
-        else
-        {
-          return $res;
-        }
+        return $this-&gt;Query(&quot;delete&quot;, $sql, $query-&gt;parameters);
         break;
       case &quot;insert&quot;:
         $ks = array();
@@ -125,15 +117,7 @@ class Krai_Db_Handler_Mysql extends Krai_Db_Handler
         $ks = implode(&quot;, &quot;, $ks);
 
         $sql = &quot;INSERT INTO &quot;.$this-&gt;GetJoins($query-&gt;tables).&quot; (&quot;.$ks.&quot;) VALUES &quot;.$vss;
-        $q = $this-&gt;Query($sql, $vals);
-        if($this-&gt;Affected($q) &gt; 0)
-        {
-          return $this-&gt;Inserted($q);
-        }
-        else
-        {
-          return false;
-        }
+        return $this-&gt;Query(&quot;insert&quot;, $sql, $vals);
         break;
       case &quot;update&quot;:
         $flds = array();
@@ -152,42 +136,46 @@ class Krai_Db_Handler_Mysql extends Krai_Db_Handler
         }
         $flds = implode(&quot;, &quot;, $flds);
         $sql = &quot;UPDATE &quot;.$this-&gt;GetJoins($query-&gt;tables).&quot; SET &quot;.$flds.&quot; WHERE &quot;.$query-&gt;conditions.(($query-&gt;limit != &quot;&quot;) ? &quot; LIMIT &quot;.$query-&gt;limit : &quot;&quot;);
-        $q = $this-&gt;Query($sql, array_merge($vals, $query-&gt;parameters));
-        if($q instanceOf Krai_Db_Query)
-        {
-          return $this-&gt;Affected($q);
-        }
-        else
-        {
-          return $q;
-        }
+        return $this-&gt;Query(&quot;update&quot;, $sql, array_merge($vals, $query-&gt;parameters));
         break;
     }
   }
 
-  public function Query($sql, array $params = array())
+  public function Query($querytype, $sql, array $params = array())
   {
+    if(!in_array($querytype, array(&quot;select&quot;,&quot;update&quot;,&quot;insert&quot;,&quot;delete&quot;,&quot;transaction&quot;)))
+    {
+      throw new Krai_Db_Exception(&quot;Unrecognized query type provided.&quot;);
+    }
+
     $tstart = microtime(true);
     list($spats, $bpars) = $this-&gt;ParseQueryParams($params);
     $sql_real = preg_replace(&quot;#/\?#&quot;,&quot;?&quot;,preg_replace($spats, $bpars, $sql, 1));
 
     if($this-&gt;CONFIG[&quot;DEBUG&quot;])
     {
-      Krai::Notice($sql);
-      Krai::Notice($sql_real);
+      print $sql;
+      print $sql_real;
     }
 
     $query = $this-&gt;_dbc-&gt;query($sql_real);
 
     $tstop = microtime(true);
 
-    Krai::WriteLog($sql_real, Krai::LOG_DEBUG, array(&quot;sql&quot;));
+    Krai::WriteLog($sql_real. &quot;:: &quot;.($tstop - $tstart).&quot;s&quot;, Krai::LOG_DEBUG, array(&quot;sql&quot;));
 
-    if(!$query)
+    /*if(!$query)
     {
-      throw new Krai_Db_Exception($this-&gt;error(&quot;text&quot;), $this-&gt;error(&quot;number&quot;));
-    }
-    return new Krai_Db_Query(($query instanceOf mysqli_result) ? $query : array($query, $this-&gt;_dbc-&gt;affected_rows, $this-&gt;_dbc-&gt;insert_id));
+      throw new Krai_Db_Exception($this-&gt;error(&quot;text&quot;).$this-&gt;error(&quot;number&quot;));
+    }*/
+
+    return new Krai_Db_Query($query, array(
+      &quot;affected&quot; =&gt; ($querytype != &quot;select&quot; &amp;&amp; $querytype != &quot;transaction&quot;) ? $this-&gt;_dbc-&gt;affected_rows : null,
+      &quot;insertid&quot; =&gt; ($querytype == &quot;insert&quot;) ? $this-&gt;_dbc-&gt;insert_id : null,
+      &quot;numrows&quot; =&gt; ($querytype == &quot;select&quot;) ? $query-&gt;num_rows : null,
+      &quot;successful&quot; =&gt; ($querytype != &quot;select&quot; &amp;&amp; $querytype != &quot;transaction&quot;) ? $query : (($query) ? true : false ),
+      &quot;error&quot; =&gt; array($this-&gt;_dbc-&gt;error, $this-&gt;_dbc-&gt;errno)
+      ));
 
   }
 
@@ -196,19 +184,19 @@ class Krai_Db_Handler_Mysql extends Krai_Db_Handler
     switch(strtolower($_action))
     {
       case &quot;start&quot;:
-        if(!$this-&gt;Query(&quot;START TRANSACTION&quot;))
+        if(!$this-&gt;Query(&quot;transaction&quot;,&quot;START TRANSACTION&quot;))
         {
           throw new Krai_Db_Exception(&quot;Unable to start transaction.&quot;);
         }
         break;
       case &quot;commit&quot;:
-        if(!$this-&gt;Query(&quot;COMMIT&quot;))
+        if(!$this-&gt;Query(&quot;transaction&quot;,&quot;COMMIT&quot;))
         {
           throw new Krai_Db_Exception(&quot;Unable to commit transaction.&quot;);
         }
         break;
       case &quot;rollback&quot;:
-        if(!$this-&gt;Query(&quot;ROLLBACK&quot;))
+        if(!$this-&gt;Query(&quot;transaction&quot;,&quot;ROLLBACK&quot;))
         {
           throw new Krai_Db_Exception(&quot;Unable to rollback transaction.&quot;);
         }
@@ -276,8 +264,8 @@ class Krai_Db_Handler_Mysql extends Krai_Db_Handler
 
   public function Fetch(Krai_Db_Query &amp;$qid)
   {
-    $row = (!$qid-&gt;IsClosed() &amp;&amp; $this-&gt;Rows($qid) &gt; 0) ? $qid-&gt;fetch_object(&quot;Krai_Db_Object&quot;) : null;
-    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $this-&gt;Rows($qid) == 1))
+    $row = (!$qid-&gt;IsClosed() &amp;&amp; $qid-&gt;NumRows() &gt; 0) ? $qid-&gt;fetch_object(&quot;Krai_Db_Object&quot;) : null;
+    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $qid-&gt;NumRows() == 1))
     {
       $qid-&gt;Close();
     }
@@ -287,7 +275,7 @@ class Krai_Db_Handler_Mysql extends Krai_Db_Handler
   public function FetchArray(Krai_Db_Query &amp;$qid)
   {
     $row = (!$qid-&gt;IsClosed()) ? $qid-&gt;fetch_assoc() : null;
-    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $this-&gt;Rows($qid) == 1))
+    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $qid-&gt;NumRows() == 1))
     {
       $qid-&gt;Close();
     }
@@ -297,19 +285,14 @@ class Krai_Db_Handler_Mysql extends Krai_Db_Handler
   public function FetchOne(Krai_Db_Query &amp;$qid)
   {
     $row = (!$qid-&gt;IsClosed()) ? $qid-&gt;fetch_row() : null;
-    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $this-&gt;Rows($qid) == 1))
+    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $qid-&gt;NumRows() == 1))
     {
       $qid-&gt;Close();
     }
     return $row[0];
   }
 
-  public function Rows(Krai_Db_Query $qid)
-  {
-    return $qid-&gt;num_rows;
-  }
-
-  public function Error(Krai_Db_Query $qid, $ret)
+  /*public function Error(Krai_Db_Query $qid, $ret)
   {
     if($ret == &quot;text&quot;)
     {
@@ -327,34 +310,39 @@ class Krai_Db_Handler_Mysql extends Krai_Db_Handler
     {
       throw new Krai_Db_Exception(&quot;Un-recognized return type option passed to Krai_DbMysql::Error.&quot;);
     }
-  }
+  }*/
 
-  public function Affected(Krai_Db_Query $qid)
+  /*public function Affected(Krai_Db_Query $qid)
   {
     $d = $qid-&gt;GetQuery();
     if(is_array($d))
     {
       return $d[1];
     }
-  }
+  }*/
 
-  public function Inserted(Krai_Db_Query $qid)
+  /*public function Inserted(Krai_Db_Query $qid)
   {
     $d = $qid-&gt;GetQuery();
     if(is_array($d))
     {
       return $d[2];
     }
-  }
+  }*/
 
-  public function Result(Krai_Db_Query $qid)
+  /*public function Result(Krai_Db_Query $qid)
   {
     $d = $qid-&gt;GetQuery();
     if(is_array($d))
     {
       return $d[0];
     }
-  }
+  }*/
+
+  /*public function Rows(Krai_Db_Query $qid)
+  {
+    return $qid-&gt;num_rows;
+  }*/
 
   /**
    * Escape the parameter so it is safe to insert into a query</diff>
      <filename>Krai/Db/Handler/Mysql.php</filename>
    </modified>
    <modified>
      <diff>@@ -11,9 +11,9 @@
  * @license http://www.opensource.org/licenses/mit-license.php MIT License
  */
 
-Krai::Uses(
+/*Krai::Uses(
   Krai::$FRAMEWORK.&quot;/Db/Querypdo.php&quot;
-);
+);*/
 
 /**
  * PDO database handler
@@ -58,9 +58,9 @@ class Krai_Db_Handler_Pdo extends Krai_Db_Handler
   {
     switch($query-&gt;action)
     {
-      case &quot;find&quot;:
+      case &quot;select&quot;:
         $sql = &quot;SELECT &quot;.((count($query-&gt;fields) &gt; 0) ? implode(&quot;, &quot;, $query-&gt;fields) : &quot;*&quot;).&quot; FROM &quot;.$this-&gt;GetJoins($query-&gt;tables).(($query-&gt;conditions != &quot;&quot;) ? &quot; WHERE &quot;.$query-&gt;conditions : &quot;&quot;).(($query-&gt;order != &quot;&quot;) ? &quot; ORDER BY &quot;. $query-&gt;order : &quot;&quot;).(($query-&gt;limit != &quot;&quot;) ? &quot; LIMIT &quot;.$query-&gt;limit : &quot;&quot;);
-        $q = $this-&gt;Query($sql, $query-&gt;parameters);
+        $q = $this-&gt;Query(&quot;select&quot;, $sql, $query-&gt;parameters);
 
         if($query-&gt;limit != &quot;1&quot;)
         {
@@ -78,16 +78,7 @@ class Krai_Db_Handler_Pdo extends Krai_Db_Handler
         break;
       case &quot;delete&quot;:
         $sql = &quot;DELETE FROM &quot;.$this-&gt;GetJoins($query-&gt;tables).(($query-&gt;conditions != &quot;&quot;) ? &quot; WHERE &quot;.$query-&gt;conditions : &quot;&quot;).(($query-&gt;limit != &quot;&quot;) ? &quot; LIMIT &quot;.$query-&gt;limit : &quot;&quot;);
-        $res = $this-&gt;Query($sql, $query-&gt;parameters);
-        if($res instanceOf Krai_Db_Query)
-        {
-          return $this-&gt;Affected($res);
-        }
-        else
-        {
-          return $res;
-        }
-        //return $this-&gt;Query($sql, $query-&gt;parameters);
+        return $this-&gt;Query(&quot;delete&quot;, $sql, $query-&gt;parameters);
         break;
       case &quot;insert&quot;:
         $ks = array();
@@ -134,15 +125,7 @@ class Krai_Db_Handler_Pdo extends Krai_Db_Handler
         $ks = implode(&quot;, &quot;, $ks);
 
         $sql = &quot;INSERT INTO &quot;.$this-&gt;GetJoins($query-&gt;tables).&quot; (&quot;.$ks.&quot;) VALUES &quot;.$vss;
-        $q = $this-&gt;Query($sql, $vals);
-        if($this-&gt;Affected($q) &gt; 0)
-        {
-          return $this-&gt;Inserted($q);
-        }
-        else
-        {
-          return false;
-        }
+        return $this-&gt;Query(&quot;insert&quot;, $sql, $vals);
         break;
       case &quot;update&quot;:
         $flds = array();
@@ -161,25 +144,21 @@ class Krai_Db_Handler_Pdo extends Krai_Db_Handler
         }
         $flds = implode(&quot;, &quot;, $flds);
         $sql = &quot;UPDATE &quot;.$this-&gt;GetJoins($query-&gt;tables).&quot; SET &quot;.$flds.&quot; WHERE &quot;.$query-&gt;conditions.(($query-&gt;limit != &quot;&quot;) ? &quot; LIMIT &quot;.$query-&gt;limit : &quot;&quot;);
-        $q = $this-&gt;Query($sql, array_merge($vals, $query-&gt;parameters));
-        if($q instanceOf Krai_Db_Query)
-        {
-          return $this-&gt;Affected($q);
-        }
-        else
-        {
-          return $q;
-        }
+        return $this-&gt;Query(&quot;update&quot;,$sql, array_merge($vals, $query-&gt;parameters));
         break;
     }
   }
 
-  public function Query($sql, array $params = array())
+  public function Query($querytype, $sql, array $params = array())
   {
+    if(!in_array($querytype, array(&quot;select&quot;,&quot;update&quot;,&quot;insert&quot;,&quot;delete&quot;,&quot;transaction&quot;)))
+    {
+      throw new Krai_Db_Exception(&quot;Unrecognized query type provided.&quot;);
+    }
     $tstart = microtime(true);
 
     $stmtkey = md5($sql);
-    if(!array_key_exists($stmtkey,$this-&gt;_prepared_statements))
+    if(!array_key_exists($stmtkey, $this-&gt;_prepared_statements))
     {
       $stmt = $this-&gt;_dbc-&gt;prepare($sql);
       $this-&gt;_prepared_statements[$stmtkey] = $stmt;
@@ -191,19 +170,12 @@ class Krai_Db_Handler_Pdo extends Krai_Db_Handler
 
     if($this-&gt;CONFIG[&quot;DEBUG&quot;])
     {
-      Krai::Notice($sql.&quot; &quot;.serialize($params));
+      print $sql.&quot; &quot;.serialize($params);
     }
 
     $query = $stmt-&gt;execute($params);
 
-    Krai::WriteLog($sql.&quot; &quot;.serialize($params), Krai::LOG_DEBUG, array(&quot;sql&quot;));
-
-    if(!$query)
-    {
-      throw new Krai_Db_Exception($this-&gt;Error(&quot;text&quot;), is_integer($this-&gt;Error(&quot;number&quot;)) ? $this-&gt;Error(&quot;number&quot;) : 0);
-    }
-
-    if(preg_match(&quot;#^SELECT\s#i&quot;,$sql))
+    if($querytype == &quot;select&quot;)
     {
       if(preg_match(&quot;#^SELECT\s.*?COUNT.*?\sFROM\s#i&quot;, $sql))
       {
@@ -211,8 +183,7 @@ class Krai_Db_Handler_Pdo extends Krai_Db_Handler
       }
       else
       {
-
-        $sql2 = preg_replace(&quot;#^SELECT\s.*?\sFROM(\s)#i&quot;,&quot;SELECT COUNT(*) FROM$1&quot;,$sql);
+        $sql2 = preg_replace(&quot;#^SELECT\s.*?\sFROM(\s)#i&quot;,&quot;SELECT COUNT(*) FROM$1&quot;,$sql,1);
         $stmtkey2 = md5($sql2);
 
         if(!array_key_exists($stmtkey2, $this-&gt;_prepared_statements))
@@ -225,24 +196,33 @@ class Krai_Db_Handler_Pdo extends Krai_Db_Handler
           $stmt2 = $this-&gt;_prepared_statements[$stmtkey2];
         }
 
-        Krai::WriteLog($sql2.&quot; &quot;.serialize($params), Krai::LOG_DEBUG, array(&quot;sql&quot;));
-
         $countq = $stmt2-&gt;execute($params);
         $count = $stmt2-&gt;fetchColumn();
       }
-      $sel = true;
-    }
-    else
-    {
-      $sel = false;
     }
 
     $tstop = microtime(true);
 
+    Krai::WriteLog($sql2.&quot; &quot;.serialize($params), Krai::LOG_DEBUG, array(&quot;sql&quot;));
+    Krai::WriteLog($sql.&quot; &quot;.serialize($params).&quot; :: &quot;.($tstop - $tstart).&quot;s&quot;, Krai::LOG_DEBUG, array(&quot;sql&quot;));
+
+    $error = $stmt-&gt;errorInfo();
+    if(is_array($error))
+    {
+      $error = array($error[2], $error[1]);
+    }
+    else
+    {
+      $error = array(null, null);
+    }
 
-    $ret = ($query) ? new Krai_Db_Querypdo($stmt, ($sel) ? $count : $query) : $query;
-    Krai::WriteLog(serialize(gettype($ret)).&quot; &quot;.serialize($count), Krai::LOG_DEBUG, array(&quot;sql&quot;));
-    return $ret;
+    return new Krai_Db_Query($stmt, array(
+      &quot;affected&quot; =&gt; ($querytype != &quot;select&quot; &amp;&amp; $querytype != &quot;transaction&quot;) ? $stmt-&gt;rowCount() : null,
+      &quot;insertid&quot; =&gt; ($querytype == &quot;insert&quot;) ? $this-&gt;_dbc-&gt;lastInsertId() : null,
+      &quot;numrows&quot; =&gt; ($querytype == &quot;select&quot;) ? $count : null,
+      &quot;successful&quot; =&gt; $query,
+      &quot;error&quot; =&gt; $error
+    ));
 
   }
 
@@ -275,9 +255,8 @@ class Krai_Db_Handler_Pdo extends Krai_Db_Handler
 
   public function Fetch(Krai_Db_Query &amp;$qid)
   {
-    $row = (!$qid-&gt;IsClosed() &amp;&amp; $this-&gt;Rows($qid) &gt; 0) ? $qid-&gt;fetchObject(&quot;Krai_Db_Object&quot;) : null;
-    Krai::WriteLog(serialize($qid-&gt;IsClosed()).&quot; &quot;.serialize($this-&gt;Rows($qid)).&quot; &quot;.serialize($row), Krai::LOG_DEBUG, array(&quot;sql&quot;));
-    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $this-&gt;Rows($qid) == 1))
+    $row = (!$qid-&gt;IsClosed() &amp;&amp; $qid-&gt;NumRows() &gt; 0) ? $qid-&gt;fetchObject(&quot;Krai_Db_Object&quot;) : null;
+    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $qid-&gt;NumRows() == 1))
     {
       $qid-&gt;Close();
     }
@@ -286,8 +265,8 @@ class Krai_Db_Handler_Pdo extends Krai_Db_Handler
 
   public function FetchArray(Krai_Db_Query &amp;$qid)
   {
-    $row = (!$qid-&gt;IsClosed()) ? $qid-&gt;fetch(PDO::FETCH_ASSOC) : null;
-    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $this-&gt;Rows($qid) == 1))
+    $row = (!$qid-&gt;IsClosed() &amp;&amp; $qid-&gt;NumRows() &gt; 0) ? $qid-&gt;fetch(PDO::FETCH_ASSOC) : null;
+    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $qid-&gt;NumRows() == 1))
     {
       $qid-&gt;Close();
     }
@@ -296,20 +275,20 @@ class Krai_Db_Handler_Pdo extends Krai_Db_Handler
 
   public function FetchOne(Krai_Db_Query &amp;$qid)
   {
-    $row = (!$qid-&gt;IsClosed()) ? $qid-&gt;fetch(PDO::FETCH_NUM) : null;
-    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $this-&gt;Rows($qid) == 1))
+    $row = (!$qid-&gt;IsClosed() &amp;&amp; $qid-&gt;NumRows() &gt; 0) ? $qid-&gt;fetch(PDO::FETCH_NUM) : null;
+    if(!$qid-&gt;IsClosed() &amp;&amp; (!$row || $qid-&gt;NumRows() == 1))
     {
       $qid-&gt;Close();
     }
     return $row[0];
   }
 
-  public function Rows(Krai_Db_Query $qid)
+  /*public function Rows(Krai_Db_Query $qid)
   {
     return $qid-&gt;NumRows();
-  }
+  }*/
 
-  public function Error(Krai_Db_Query $qid, $ret)
+  /*public function Error(Krai_Db_Query $qid, $ret)
   {
     $stmt = $qid-&gt;GetQuery();
     $einfo = $stmt-&gt;errorInfo();
@@ -331,18 +310,18 @@ class Krai_Db_Handler_Pdo extends Krai_Db_Handler
     {
       throw new Krai_Db_Exception(&quot;Un-recognized return type option passed to Krai_Db_Handler_Pdo::Error.&quot;);
     }
-  }
+  }*/
 
-  public function Affected(Krai_Db_Query $qid)
+  /*public function Affected(Krai_Db_Query $qid)
   {
     $stmt = $qid-&gt;GetQuery();
     return $stmt-&gt;rowCount();
-  }
+  }*/
 
-  public function Inserted(Krai_Db_Query $qid)
+  /*public function Inserted(Krai_Db_Query $qid)
   {
     return $this-&gt;_dbc-&gt;lastInsertId();
-  }
+  }*/
 
   /**
    * Generates DSN strings for a variety of databases from the $dbinfo</diff>
      <filename>Krai/Db/Handler/Pdo.php</filename>
    </modified>
    <modified>
      <diff>@@ -39,13 +39,30 @@ class Krai_Db_Query
   protected $_Query = null;
 
   /**
+   * Holds query stats
+   *
+   * This variable holds statistics for a query such as number of rows in the result,
+   * whether it was successful, the inserted ID, and the number of affected rows.
+   *
+   * @var array
+   */
+  protected $_Stats = array(
+    &quot;successful&quot; =&gt; false,
+    &quot;insertid&quot; =&gt; null,
+    &quot;affected&quot; =&gt; null,
+    &quot;numrows&quot; =&gt; null,
+    &quot;error&quot; =&gt; array(null, null)
+  );
+
+  /**
    * Constructor.  Saves the passed query to the instance
    *
    * @param mixed $query
    */
-  function __construct($query)
+  function __construct($query, $stats)
   {
     $this-&gt;_Query = $query;
+    $this-&gt;_Stats = array_merge($this-&gt;_Stats, $stats);
   }
 
   /**
@@ -72,6 +89,7 @@ class Krai_Db_Query
     {
       $this-&gt;_Query-&gt;close();
     }
+    $this-&gt;_Query = null;
     $this-&gt;_Closed = true;
   }
 
@@ -87,24 +105,22 @@ class Krai_Db_Query
    */
   public function __call($m, $p)
   {
-    if($m != &quot;Close&quot; &amp;&amp; $m != &quot;IsClosed&quot;)
+    if($this-&gt;_Closed)
+    {
+      throw new Krai_Db_Exception(&quot;Tried to call method on closed query.&quot;);
+    }
+    else
     {
-      if($this-&gt;_Closed)
+      if(is_callable(array($this-&gt;_Query, $m), false))
       {
-        throw new Krai_Db_Exception(&quot;Tried to call method on closed query.&quot;);
+          return call_user_func_array(array($this-&gt;_Query, $m), $p);
       }
       else
       {
-        if(is_callable(array($this-&gt;_Query, $m), false))
-        {
-            return call_user_func_array(array($this-&gt;_Query, $m), $p);
-        }
-        else
-        {
-          throw new Krai_Db_Exception(&quot;Unknown method called on a query.&quot;);
-        }
+        throw new Krai_Db_Exception(&quot;Unknown method called on a query.&quot;);
       }
     }
+
   }
 
   /**
@@ -118,17 +134,114 @@ class Krai_Db_Query
    */
   public function __get($v)
   {
-    return $this-&gt;_Query-&gt;$v;
+    if($this-&gt;_Closed)
+    {
+      return null;
+    }
+    else
+    {
+      return $this-&gt;_Query-&gt;$v;
+    }
   }
 
   /**
    * Get a reference to the query object
    *
    * This function returns a reference to the query object wrapped in the instance
+   *
+   * @return mixed The Query object
    */
   public function &amp;GetQuery()
   {
     return $this-&gt;_Query;
   }
 
+  /**
+   * Returns whether or not the query was successful
+   *
+   * This function returns the value of the {@link Krai_Db_Query::$_Stats}
+   * &quot;successful&quot; key.
+   *
+   * @return boolean
+   *
+   */
+  public function IsSuccessful()
+  {
+    return $this-&gt;_Stats[&quot;successful&quot;];
+  }
+
+  /**
+   * Returns the number of rows in the resultset
+   *
+   * This function returns the value of the {@link Krai_Db_Query::$_Stats}
+   * &quot;numrows&quot; key.
+   *
+   * @return integer
+   *
+   */
+  public function NumRows()
+  {
+    return $this-&gt;_Stats[&quot;numrows&quot;];
+  }
+
+  /**
+   * Returns the number of affected rows
+   *
+   * This function returns the value of the {@link Krai_Db_Query::$_Stats}
+   * &quot;affected&quot; key.
+   *
+   * @return integer
+   *
+   */
+  public function Affected()
+  {
+    return $this-&gt;_Stats[&quot;affected&quot;];
+  }
+
+  /**
+   * Returns the last inserted id
+   *
+   * This function returns the value of the {@link Krai_Db_Query::$_Stats}
+   * &quot;insertid&quot; key.
+   *
+   * @return integer
+   *
+   */
+  public function InsertID()
+  {
+    return $this-&gt;_Stats[&quot;insertid&quot;];
+  }
+
+  /**
+   * Returns query error information
+   *
+   * This function returns the value of the {@link Krai_Db_Query::$_Stats}
+   * &quot;error&quot; key, formatted either as a string, as an error code, or an array of
+   * (string, error code).
+   *
+   * @param string $ret How to return the information (&quot;text&quot;,&quot;number&quot;, or &quot;array&quot;)
+   * @return mixed
+   * @throws Krai_Db_Exception
+   *
+   */
+  public function Error($ret = &quot;text&quot;)
+  {
+    if($ret == &quot;text&quot;)
+    {
+      return $this-&gt;_Stats[&quot;error&quot;][0];
+    }
+    elseif($ret == &quot;number&quot;)
+    {
+      return $this-&gt;_Stats[&quot;error&quot;][1];
+    }
+    elseif($ret == &quot;array&quot;)
+    {
+      return $this-&gt;_Stats[&quot;error&quot;];
+    }
+    else
+    {
+      throw new Krai_Db_Exception(&quot;Un-recognized return type option passed to Krai_Db_Query::Error.&quot;);
+    }
+  }
+
 }</diff>
      <filename>Krai/Db/Query.php</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@
 
 Krai::Uses(
   Krai::$FRAMEWORK.&quot;/Struct/Dbquery/Delete.php&quot;,
-  Krai::$FRAMEWORK.&quot;/Struct/Dbquery/Find.php&quot;,
+  Krai::$FRAMEWORK.&quot;/Struct/Dbquery/Select.php&quot;,
   Krai::$FRAMEWORK.&quot;/Struct/Dbquery/Insert.php&quot;,
   Krai::$FRAMEWORK.&quot;/Struct/Dbquery/Update.php&quot;
 );</diff>
      <filename>Krai/Struct/Dbquery.php</filename>
    </modified>
    <modified>
      <diff>@@ -15,6 +15,9 @@ Removed Text_Wiki built-in library. Dependent on PEAR now.
 
 Merged Krai_Base with Krai. Removed Krai_Base.
 
+Changed how Db handlers return data. Moved query stats into Query objects. Re-named
+  FindQuery to SelectQuery
+
 == From KvFramework 2.0b6 ==
 
 Renamed most things.</diff>
      <filename>MIGRATION</filename>
    </modified>
    <modified>
      <diff>@@ -75,7 +75,7 @@ class User
   public function __construct(Krai_Db_Object $_data)
   {
     $this-&gt;_DBDATA = $_data;
-    $q = Krai::$DB-&gt;FindQuery(array(&quot;user_roles as ur&quot;,&quot;roles as r&quot;));
+    $q = Krai::$DB-&gt;SelectQuery(array(&quot;user_roles as ur&quot;,&quot;roles as r&quot;));
     $q-&gt;conditions = &quot;ur.user_id = ? AND ur.role_id = ? AND r.role_id = ur.role_id&quot;;
     $q-&gt;parameters = array($this-&gt;_DBDATA-&gt;user_id, 'sysop');
     $q-&gt;fields = array(&quot;ur.role_id&quot;);
@@ -140,7 +140,7 @@ class User
       $p .= &quot;?, &quot;;
     }
 
-    $q = Krai::$DB-&gt;FindQuery(array(&quot;user_roles as ur&quot;,&quot;roles as r&quot;));
+    $q = Krai::$DB-&gt;SelectQuery(array(&quot;user_roles as ur&quot;,&quot;roles as r&quot;));
     $q-&gt;conditions = &quot;ur.user_id = ? AND ur.role_id IN (&quot;.substr($p,0,-2).&quot;) AND r.role_id = ur.role_id&quot;;
     $q-&gt;parameters = array_merge(array($this-&gt;_DBDATA-&gt;user_id),$as-&gt;requires);
     $q-&gt;fields = array(&quot;ur.role_id&quot;);
@@ -190,7 +190,7 @@ class User
       self::$_PrivLookups[intval($_user_id)] = array();
     }
 
-    $q = Krai::$DB-&gt;FindQuery(array(&quot;user_roles as ur&quot;,&quot;users as u&quot;,&quot;roles as r&quot;));
+    $q = Krai::$DB-&gt;SelectQuery(array(&quot;user_roles as ur&quot;,&quot;users as u&quot;,&quot;roles as r&quot;));
     $q-&gt;conditions = &quot;ur.role_id = ? AND ur.user_id = ? AND u.user_id = ur.user_id AND r.role_id = ur.role_id&quot;;
     $q-&gt;parameters = array($_priv_name, $_user_id);
     $q-&gt;fields = array(&quot;ur.role_id&quot;,&quot;ur.user_id&quot;);</diff>
      <filename>script/demo/includes/lib/user.class.php</filename>
    </modified>
    <modified>
      <diff>@@ -138,7 +138,7 @@ class ApplicationModule extends Krai_Module
     }
 
     // check to see if user has an active session using the session string found in cookie
-    $q  = self::$DB-&gt;FindQuery(array('sessions as s', 'users as u' =&gt; &quot;s.user_id = u.user_id&quot;));
+    $q  = self::$DB-&gt;SelectQuery(array('sessions as s', 'users as u' =&gt; &quot;s.user_id = u.user_id&quot;));
     $q-&gt;fields = array('s.session_id','s.started','s.lastact','s.useragent','s.ipaddr','u.*');
     $q-&gt;conditions = &quot;s.session_id = ?&quot;;
     $q-&gt;limit = &quot;1&quot;;
@@ -182,7 +182,7 @@ class ApplicationModule extends Krai_Module
     $q-&gt;limit = &quot;1&quot;;
 
     $res = self::$DB-&gt;Process($q);
-    return ($res instanceOf Krai_Db_Query) ? self::$DB-&gt;Result($res) : $res;
+    return $res-&gt;IsSuccessful();
   }
 
   /**</diff>
      <filename>script/demo/includes/modules/application.module/application.module.php</filename>
    </modified>
    <modified>
      <diff>@@ -166,11 +166,11 @@ class PageModule_EditAction extends Krai_Module_Action
 
             $res = self::$DB-&gt;Process($q);
 
-            if(self::$DB-&gt;Result($res))
+            if($res-&gt;IsSuccessful())
             {
               $q = self::$DB-&gt;UpdateQuery(array(&quot;pages&quot;));
               $q-&gt;fields = array(
-                                 &quot;page_revision&quot; =&gt; $res,
+                                 &quot;page_revision&quot; =&gt; $res-&gt;InsertID(),
                                  &quot;page_updated&quot; =&gt; time()
                                  );
               $q-&gt;conditions = &quot;page_id = ?&quot;;
@@ -179,7 +179,7 @@ class PageModule_EditAction extends Krai_Module_Action
 
               $res2 = self::$DB-&gt;Process($q);
 
-              if(self::$DB-&gt;Result($res2))
+              if($res2-&gt;IsSuccessful())
               {
                 self::$DB-&gt;Transaction(&quot;commit&quot;);
                 self::Notice(&quot;Revision saved successfully.&quot;);</diff>
      <filename>script/demo/includes/modules/page.module/actions/edit.action.php</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@ class PageModule_ListAction extends Krai_Module_Action
 
   public function Process()
   {
-    $q = self::$DB-&gt;FindQuery(array(&quot;pages as p&quot;, &quot;page_revisions as r&quot;));
+    $q = self::$DB-&gt;SelectQuery(array(&quot;pages as p&quot;, &quot;page_revisions as r&quot;));
     $q-&gt;conditions = &quot;p.page_indexed = ? AND r.page_id = p.page_id AND r.rev_id = p.page_revision&quot;;
     $q-&gt;parameters = array(&quot;yes&quot;);
     $q-&gt;order = &quot;r.rev_page_name AND p.page_id&quot;;</diff>
      <filename>script/demo/includes/modules/page.module/actions/list.action.php</filename>
    </modified>
    <modified>
      <diff>@@ -83,7 +83,7 @@ class PageModule_SetrevAction extends Krai_Module_Action
 
       $res2 = self::$DB-&gt;Process($q);
 
-      if(self::$DB-&gt;Result($res2))
+      if($res2-&gt;IsSuccessful())
       {
         self::$DB-&gt;Transaction(&quot;commit&quot;);
         self::Notice(&quot;Revision saved successfully.&quot;);</diff>
      <filename>script/demo/includes/modules/page.module/actions/setrev.action.php</filename>
    </modified>
    <modified>
      <diff>@@ -42,14 +42,14 @@ class PageModule extends ApplicationModule
   {
     if(is_null($_rev_id))
     {
-      $q = self::$DB-&gt;FindQuery(array(&quot;pages as p&quot;,&quot;page_revisions as pr&quot; =&gt; &quot;pr.rev_id = p.page_revision&quot;,&quot;users as u&quot; =&gt; &quot;u.user_id = pr.rev_user&quot;));
+      $q = self::$DB-&gt;SelectQuery(array(&quot;pages as p&quot;,&quot;page_revisions as pr&quot; =&gt; &quot;pr.rev_id = p.page_revision&quot;,&quot;users as u&quot; =&gt; &quot;u.user_id = pr.rev_user&quot;));
       $q-&gt;fields = array(&quot;u.*&quot;,&quot;pr.*&quot;,&quot;p.*&quot;);
       $q-&gt;conditions = &quot;p.page_id = ?&quot;;
       $q-&gt;parameters = array($_page_id);
     }
     else
     {
-      $q = self::$DB-&gt;FindQuery(array(&quot;pages as p&quot;,&quot;page_revisions as pr&quot; =&gt; &quot;pr.page_id = p.page_id&quot;,&quot;users as u&quot; =&gt; &quot;u.user_id = pr.rev_user&quot;));
+      $q = self::$DB-&gt;SelectQuery(array(&quot;pages as p&quot;,&quot;page_revisions as pr&quot; =&gt; &quot;pr.page_id = p.page_id&quot;,&quot;users as u&quot; =&gt; &quot;u.user_id = pr.rev_user&quot;));
       $q-&gt;fields = array(&quot;u.*&quot;,&quot;pr.*&quot;,&quot;p.*&quot;);
       $q-&gt;conditions = &quot;p.page_id = ? AND pr.rev_id = ?&quot;;
       $q-&gt;parameters = array($_page_id, $_rev_id);
@@ -69,7 +69,7 @@ class PageModule extends ApplicationModule
    */
   public function GetAllRevisions($_page_id, $_orderby = null)
   {
-    $q = self::$DB-&gt;FindQuery(array(&quot;pages as p&quot;, &quot;page_revisions as pr&quot;, &quot;users as u&quot; =&gt; &quot;u.user_id = pr.rev_user&quot;));
+    $q = self::$DB-&gt;SelectQuery(array(&quot;pages as p&quot;, &quot;page_revisions as pr&quot;, &quot;users as u&quot; =&gt; &quot;u.user_id = pr.rev_user&quot;));
     $q-&gt;fields = array(&quot;u.*&quot;,&quot;pr.rev_page_name&quot;,&quot;pr.rev_date&quot;,&quot;pr.rev_id&quot;,&quot;p.*&quot;);
     $q-&gt;conditions = &quot;pr.page_id = p.page_id AND p.page_id = ?&quot;;
     $q-&gt;parameters = array($_page_id);
@@ -100,7 +100,7 @@ class PageModule extends ApplicationModule
       return true;
     }
 
-    $q = self::$DB-&gt;FindQuery(array(&quot;page_owners as po&quot;));
+    $q = self::$DB-&gt;SelectQuery(array(&quot;page_owners as po&quot;));
     $q-&gt;conditions = &quot;po.user_id = ? AND po.page_id = ?&quot;;
     $q-&gt;parameters = array(self::$_USER-&gt;user_id, $_page_id);
     $q-&gt;limit = &quot;1&quot;;</diff>
      <filename>script/demo/includes/modules/page.module/page.module.php</filename>
    </modified>
    <modified>
      <diff>@@ -92,7 +92,7 @@ class UserModule_ChangepassAction extends Krai_Module_Action
       );
 
       $res = self::$DB-&gt;Process($q);
-      if(self::$DB-&gt;Result($res))
+      if($res-&gt;IsSuccessful())
       {
         self::$DB-&gt;Transaction(&quot;commit&quot;);
         self::Notice(&quot;Password Changed.&quot;);</diff>
      <filename>script/demo/includes/modules/user.module/actions/changepass.action.php</filename>
    </modified>
    <modified>
      <diff>@@ -43,7 +43,7 @@ class UserModule_ConfirmAction extends Krai_Module_Action
       switch(self::$GET[&quot;type&quot;])
       {
         case &quot;register&quot;:
-          $q = self::$DB-&gt;FindQuery(array(&quot;users&quot;));
+          $q = self::$DB-&gt;SelectQuery(array(&quot;users&quot;));
           $q-&gt;conditions = &quot;user_id = ? AND activation_code = ?&quot;;
           $q-&gt;parameters = array(self::$GET[&quot;id&quot;], self::$GET[&quot;code&quot;]);
           $q-&gt;fields = array(&quot;user_id&quot;);
@@ -65,8 +65,8 @@ class UserModule_ConfirmAction extends Krai_Module_Action
             );
 
             $res = self::$DB-&gt;Process($q);
-            $res = self::$DB-&gt;Result($res);
-            if($res || $res === 0)
+            $res = $res-&gt;IsSuccessful();
+            if($res)
             {
               $q = self::$DB-&gt;UpdateQuery(array(&quot;users&quot;));
               $q-&gt;conditions = &quot;user_id = ?&quot;;
@@ -87,7 +87,7 @@ class UserModule_ConfirmAction extends Krai_Module_Action
           }
           break;
         case &quot;email&quot;:
-          $q = self::$DB-&gt;FindQuery(array(&quot;users&quot;));
+          $q = self::$DB-&gt;SelectQuery(array(&quot;users&quot;));
           $q-&gt;conditions = &quot;user_id = ? AND confirmation_code = ?&quot;;
           $q-&gt;parameters = array(self::$GET[&quot;id&quot;], self::$GET[&quot;code&quot;]);
           $q-&gt;fields = array(&quot;user_id&quot;,&quot;new_email&quot;);
@@ -105,7 +105,7 @@ class UserModule_ConfirmAction extends Krai_Module_Action
 
             $res = self::$DB-&gt;Process($q);
 
-            if(self::$DB-&gt;Result($res))
+            if($res-&gt;IsSuccessful())
             {
               self::$DB-&gt;Transaction(&quot;commit&quot;);
               self::Notice(&quot;E-mail confirmation was successful.&quot;);</diff>
      <filename>script/demo/includes/modules/user.module/actions/confirm.action.php</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,7 @@ class UserModule_DirectoryAction extends Krai_Module_Action
 
   public function Process()
   {
-    $q = self::$DB-&gt;FindQuery(array(&quot;users as u&quot;));
+    $q = self::$DB-&gt;SelectQuery(array(&quot;users as u&quot;));
     $q-&gt;fields = array(&quot;u.*&quot;);
     $q-&gt;conditions = &quot;u.directory_list = 'yes'&quot;;
     $q-&gt;order = &quot;displayname, username&quot;;</diff>
      <filename>script/demo/includes/modules/user.module/actions/directory.action.php</filename>
    </modified>
    <modified>
      <diff>@@ -79,7 +79,7 @@ class UserModule_EditAction extends Krai_Module_Action
       //Check for e-mail uniqueness
       if(!array_key_exists(&quot;email&quot;, $this-&gt;_errorfields))
       {
-        $q = self::$DB-&gt;FindQuery(array(&quot;users&quot;));
+        $q = self::$DB-&gt;SelectQuery(array(&quot;users&quot;));
         $q-&gt;conditions = &quot;(email = ? OR new_email = ?) AND user_id != ?&quot;;
         $q-&gt;parameters = array(self::$POST[&quot;email&quot;], self::$POST[&quot;email&quot;], $this-&gt;_parent-&gt;USER-&gt;user_id);
         $q-&gt;limit = &quot;1&quot;;
@@ -126,7 +126,7 @@ class UserModule_EditAction extends Krai_Module_Action
 
       $res = self::$DB-&gt;Process($q);
 
-      if(self::$DB-&gt;Result($res))
+      if($res-&gt;IsSuccessful())
       {
         if($this-&gt;_parent-&gt;USER-&gt;email != self::$POST[&quot;email&quot;])
         {</diff>
      <filename>script/demo/includes/modules/user.module/actions/edit.action.php</filename>
    </modified>
    <modified>
      <diff>@@ -89,7 +89,7 @@ class UserModule_LoginAction extends Krai_Module_Action
     {
       $password = &quot;0x&quot;.bin2hex(sha1(self::$POST['password']));
 
-      $q = self::$DB-&gt;FindQuery(array('users as u'));
+      $q = self::$DB-&gt;SelectQuery(array('users as u'));
       $q-&gt;fields = array('u.user_id');
       $q-&gt;conditions = &quot;username = ? AND password = ?&quot;;
       $q-&gt;parameters = array(self::$POST[&quot;username&quot;], $password);
@@ -152,7 +152,7 @@ class UserModule_LoginAction extends Krai_Module_Action
           $sessionID .= $charDump{mt_rand(0,strlen($charDump)-1)};
         }
         // check to see if 32-character string already exists
-	$q = self::$DB-&gt;FindQuery('sessions');
+	$q = self::$DB-&gt;SelectQuery('sessions');
 	$q-&gt;conditions = &quot;session_id = ?&quot;;
 	$q-&gt;limit = &quot;1&quot;;
 	$q-&gt;parameters = array($sessionID);</diff>
      <filename>script/demo/includes/modules/user.module/actions/login.action.php</filename>
    </modified>
    <modified>
      <diff>@@ -69,7 +69,7 @@ class UserModule_LostpassAction extends Krai_Module_Action
         $thecode .= $dump{mt_rand(0,strlen($dump)-1)};
       }
 
-      $q = self::$DB-&gt;FindQuery(array(&quot;users&quot;));
+      $q = self::$DB-&gt;SelectQuery(array(&quot;users&quot;));
       $q-&gt;conditions = &quot;username = ?&quot;;
       $q-&gt;parameters = array(self::$POST[&quot;username&quot;]);
       $q-&gt;fields = array(&quot;user_id&quot;,&quot;email&quot;);
@@ -92,7 +92,7 @@ class UserModule_LostpassAction extends Krai_Module_Action
       );
 
       $res = self::$DB-&gt;Process($q);
-      if(self::$DB-&gt;Result($res))
+      if($res-&gt;IsSuccessful())
       {
         //Send activation email
         $mail = Krai_Mail::NewMail();</diff>
      <filename>script/demo/includes/modules/user.module/actions/lostpass.action.php</filename>
    </modified>
    <modified>
      <diff>@@ -31,7 +31,7 @@ class UserModule_ProfileAction extends Krai_Module_Action
 
   public function Process()
   {
-    $q = self::$DB-&gt;FindQuery(array(&quot;users as u&quot;));
+    $q = self::$DB-&gt;SelectQuery(array(&quot;users as u&quot;));
     $q-&gt;conditions = &quot;u.username = ?&quot;;
     $q-&gt;parameters = array(self::$PARAMS[&quot;id&quot;]);
     $q-&gt;limit = &quot;1&quot;;</diff>
      <filename>script/demo/includes/modules/user.module/actions/profile.action.php</filename>
    </modified>
    <modified>
      <diff>@@ -45,7 +45,7 @@ function page_edit_cancel()
 
 function LoadRevChooser(page_id)
 {
-  $.getJSON(_BASEURI_+'page/revisions/'+page_id, {}, function(response){
+  $.getJSON(CONFIG.BASEURI+'page/revisions/'+page_id, {}, function(response){
     if(response.result == 0)
     {
       if(response.message != &quot;ok&quot;)
@@ -63,7 +63,7 @@ function LoadRevChooser(page_id)
         var sb = $.create('select',{'class': 'selectbox single', 'size': '1', 'style': 'width: auto;', 'id': 'revision_select', 'name': 'revision_select'}, options);
         sb.change(function(){ShowRevision(page_id);});
         $('#rev_chooser').append(
-          $.create('form', {'method':'post', 'action': _BASEURI_+'page/setrev/'+page_id}, [
+          $.create('form', {'method':'post', 'action': CONFIG.BASEURI+'page/setrev/'+page_id}, [
             sb,
             ' ',
             $.create('input',{'type': 'submit','class': 'button', 'value': 'set revision'},[])
@@ -90,7 +90,7 @@ function ShowRevision(page_id)
 {
   $('#revision_select').attr(&quot;disabled&quot;,&quot;disabled&quot;);
   var rev_id = $('#revision_select option:selected').val();
-  $.getJSON(_BASEURI_+'page/revisions/'+page_id, {'rid': rev_id}, function(response){
+  $.getJSON(CONFIG.BASEURI+'page/revisions/'+page_id, {'rid': rev_id}, function(response){
     if(response.result == 0)
     {
       if(response.message != &quot;ok&quot;)</diff>
      <filename>script/demo/public/javascripts/application.js</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>Krai/Struct/Dbquery/Find.php</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>958211c017cb09695019db68a89d8fd13350202d</id>
    </parent>
  </parents>
  <author>
    <name>Greg McWhirter</name>
    <email>greg@hallofkvasir.org</email>
  </author>
  <url>http://github.com/gsmcwhirter/krai/commit/d95c7e4fbc2e573341dde1ced953ad9325d3a409</url>
  <id>d95c7e4fbc2e573341dde1ced953ad9325d3a409</id>
  <committed-date>2008-07-19T13:16:40-07:00</committed-date>
  <authored-date>2008-07-19T13:16:40-07:00</authored-date>
  <message>Refactoring some database things. Hopefully this makes PDO support more feasible again.</message>
  <tree>5794b0b53c89e19e6b3b3e3d16114d857c1bbd50</tree>
  <committer>
    <name>Greg McWhirter</name>
    <email>greg@hallofkvasir.org</email>
  </committer>
</commit>
