Vergleich inc/db_sqlite.php - 1.8.7 - 1.8.20

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 30Zeile 30
	 * @var string
*/
public $type;

	 * @var string
*/
public $type;

 

/**
* PDOStatement objects of performed queries.
*
* @var array
*/
public $query_objects = array();


/**
* A count of the number of queries.


/**
* A count of the number of queries.

Zeile 44Zeile 51
	 * @var array
*/
public $querylist = array();

	 * @var array
*/
public $querylist = array();


/**


/**

	 * 1 if error reporting enabled, 0 if disabled.
*
* @var boolean

	 * 1 if error reporting enabled, 0 if disabled.
*
* @var boolean

Zeile 58Zeile 65
	 * @var resource
*/
public $link;

	 * @var resource
*/
public $link;


/**


/**

	 * Explanation of a query.
*
* @var string

	 * Explanation of a query.
*
* @var string

Zeile 68Zeile 75

/**
* The current version of SQLite.


/**
* The current version of SQLite.

	 *

	 *

	 * @var string
*/
public $version;

	 * @var string
*/
public $version;


/**


/**

	 * The current table type in use (myisam/innodb)
*
* @var string

	 * The current table type in use (myisam/innodb)
*
* @var string

Zeile 82Zeile 89

/**
* The table prefix used for simple select, update, insert and delete queries


/**
* The table prefix used for simple select, update, insert and delete queries

	 *

	 *

	 * @var string
*/
public $table_prefix;

	 * @var string
*/
public $table_prefix;


/**


/**

	 * The extension used to run the SQL database
*
* @var string

	 * The extension used to run the SQL database
*
* @var string

Zeile 96Zeile 103

/**
* Weather or not this engine can use the search functionality


/**
* Weather or not this engine can use the search functionality

	 *

	 *

	 * @var boolean
*/
public $can_search = true;

	 * @var boolean
*/
public $can_search = true;

Zeile 105Zeile 112
	 * The database encoding currently in use (if supported)
*
* @var string

	 * The database encoding currently in use (if supported)
*
* @var string

	 */

	 */

	public $db_encoding = "";

/**

	public $db_encoding = "";

/**

Zeile 179Zeile 186
				$this->error_msg = "near \"{$queryparts[0]}\": syntax error";
}
else

				$this->error_msg = "near \"{$queryparts[0]}\": syntax error";
}
else

			{

			{

				// SQLITE 3 supports ADD and RENAME TO alter statements
if(strtolower(substr(ltrim($alterdefs), 0, 3)) == 'add' || strtolower(substr(ltrim($alterdefs), 0, 9)) == "rename to")
{

				// SQLITE 3 supports ADD and RENAME TO alter statements
if(strtolower(substr(ltrim($alterdefs), 0, 3)) == 'add' || strtolower(substr(ltrim($alterdefs), 0, 9)) == "rename to")
{

Zeile 190Zeile 197
				{
$query = $this->alter_table_parse($tablename, $alterdefs, $string);
}

				{
$query = $this->alter_table_parse($tablename, $alterdefs, $string);
}

			}

			}

		}
else
{
try
{
$query = $this->db->query($string);

		}
else
{
try
{
$query = $this->db->query($string);

			}

			}

			catch(PDOException $exception)
{
$error = array(
"message" => $exception->getMessage(),
"code" => $exception->getCode()
);

			catch(PDOException $exception)
{
$error = array(
"message" => $exception->getMessage(),
"code" => $exception->getCode()
);





				$this->error($error['message'], $error['code']);
}
}

				$this->error($error['message'], $error['code']);
}
}

 

$this->query_objects[] = $query;


if($this->error_number($query) > 0 && !$hide_errors)
{


if($this->error_number($query) > 0 && !$hide_errors)
{

Zeile 252Zeile 261
				"</tr>\n".
"<tr>\n".
"<td colspan=\"8\" style=\"background-color: #fff;\">Query Time: ".format_time_duration($qtime)."</td>\n".

				"</tr>\n".
"<tr>\n".
"<td colspan=\"8\" style=\"background-color: #fff;\">Query Time: ".format_time_duration($qtime)."</td>\n".

				"</tr>\n".
"</table>\n".

				"</tr>\n".
"</table>\n".

				"<br />\n";
}
else

				"<br />\n";
}
else

Zeile 290Zeile 299

/**
* Return a result array for a query.


/**
* Return a result array for a query.

	 *

	 *

	 * @param PDOStatement $query The result data.
* @param int $resulttype One of PDO's constants: FETCH_ASSOC, FETCH_BOUND, FETCH_CLASS, FETCH_INTO, FETCH_LAZY, FETCH_NAMED, FETCH_NUM, FETCH_OBJ or FETCH_BOTH
* @return array The array of results.

	 * @param PDOStatement $query The result data.
* @param int $resulttype One of PDO's constants: FETCH_ASSOC, FETCH_BOUND, FETCH_CLASS, FETCH_INTO, FETCH_LAZY, FETCH_NAMED, FETCH_NUM, FETCH_OBJ or FETCH_BOTH
* @return array The array of results.

Zeile 299Zeile 308
	{
$array = $this->db->fetch_array($query, $resulttype);
return $array;

	{
$array = $this->db->fetch_array($query, $resulttype);
return $array;

	}


	}


	/**
* Return a specific field from a query.

	/**
* Return a specific field from a query.

	 *
* @param PDOStatement $query The query ID.

	 *
* @param PDOStatement $query The query ID.

	 * @param string $field The name of the field to return.
* @param int|bool $row The number of the row to fetch it from.
* @return mixed

	 * @param string $field The name of the field to return.
* @param int|bool $row The number of the row to fetch it from.
* @return mixed

Zeile 314Zeile 323
		if($row !== false)
{
$this->data_seek($query, $row);

		if($row !== false)
{
$this->data_seek($query, $row);

		}

		}

		$array = $this->fetch_array($query);
return $array[$field];

		$array = $this->fetch_array($query);
return $array[$field];

	}


	}


	/**
* Moves internal row pointer to the next row
*

	/**
* Moves internal row pointer to the next row
*

Zeile 328Zeile 337
	function data_seek($query, $row)
{
$this->db->seek($query, $row);

	function data_seek($query, $row)
{
$this->db->seek($query, $row);

 
	}

/**
* Closes cursors of registered queries.
*
*/
function close_cursors()
{
$result = true;

foreach($this->query_objects as $query)
{
if(!$query->closeCursor())
{
$result = false;
}
}

return $result;

	}

/**

	}

/**

Zeile 1084Zeile 1112
	 *
* @param string $table The table
* @param array $replacements The replacements

	 *
* @param string $table The table
* @param array $replacements The replacements

	 * @param mixed $default_field The default field(s)


	 * @param string|array $default_field The default field(s)
* @param boolean $insert_id Whether or not to return an insert id. True by default

	 * @return int|PDOStatement|bool Returns either the insert id (if a new row is inserted), the query resource (if a row is updated) or false on failure
*/

	 * @return int|PDOStatement|bool Returns either the insert id (if a new row is inserted), the query resource (if a row is updated) or false on failure
*/

	function replace_query($table, $replacements=array(), $default_field="")

	function replace_query($table, $replacements=array(), $default_field="", $insert_id=true)

	{
global $mybb;


	{
global $mybb;