示例#1
0
 function executeQuery($stmt, $mode = DBA_ASSOC)
 {
     $result = mysqli_query($this->link, $stmt);
     if (!$result) {
         if (mysqli_errno($this->link) == 0) {
             return compile_error("Invalid query: Called executeQuery on an update", __FILE__, __LINE__);
         }
         return compile_error("Invalid query: " . mysqli_error($this->link), __FILE__, __LINE__);
     }
     /* Increment the number of queries */
     $this->num_queries++;
     $result =& new MysqliResultIterator($result, $mode);
     if (DEBUG_SQL) {
         set_debug_item($stmt, $result);
     }
     return $result;
 }
示例#2
0
 function GetValue($query)
 {
     $result = sqlite_query($query, $this->link);
     /* Increment the number of queries */
     $this->num_queries++;
     if (is_resource($result)) {
         if (sqlite_has_more($result)) {
             $value = sqlite_fetch_single($result);
             if (DEBUG_SQL) {
                 set_debug_item($query, $value);
             }
             return $value;
         }
     } else {
         return compile_error("Invalid query: " . sqlite_error_string(sqlite_last_error($this->link)), __FILE__, __LINE__);
     }
     return FALSE;
 }
示例#3
0
 function GetValue($query)
 {
     $result = mysql_query($query, $this->link);
     /* Increment the number of queries */
     $this->num_queries++;
     if (is_resource($result)) {
         if (mysql_num_rows($result) > 0) {
             $row = mysql_fetch_array($result, MYSQL_NUM);
             mysql_free_result($result);
             if (DEBUG_SQL) {
                 set_debug_item($query, $row[0]);
             }
             return $row[0];
         }
     } else {
         return compile_error("Invalid query: " . mysql_error($this->link), __FILE__, __LINE__);
     }
     return FALSE;
 }