本文整理汇总了PHP中ibase_query函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_query函数的具体用法?PHP ibase_query怎么用?PHP ibase_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ibase_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute($sql, $bindParams = array(), $additionalParameters = array())
{
$connection = $this->connection;
if (empty($bindParams)) {
$result = ibase_query($connection, $sql);
} else {
$holderRegex = "/@[a-zA-Z0-9_]+@/";
preg_match_all($holderRegex, $sql, $matches);
$args = array($connection, preg_replace($holderRegex, "?", $sql));
foreach ($matches[0] as $holder) {
$args[] = $bindParams[$holder];
}
$result = call_user_func_array("ibase_query", $args);
}
if (!$result) {
$this->executeError($sql);
}
$rows = array();
if (is_resource($result)) {
while ($row = ibase_fetch_assoc($result, IBASE_TEXT)) {
$rows[] = array_change_key_case($row);
}
ibase_free_result($result);
} else {
$this->affectedRows = $result === true ? 0 : $result;
}
if ($this->autoCommit) {
ibase_commit($connection);
}
return empty($rows) ? null : $rows;
}
示例2: execute_query_trans
protected function execute_query_trans($trans, $sql) {
if ($exec = ibase_query($trans, $sql))
return $exec;
//$this->gravaQueryArquivo($sql);
return false;
}
示例3: recupera_campo
function recupera_campo($campo,$tabela,$campo_condicao,$condicao) {
$consulta = "SELECT $campo FROM $tabela WHERE $campo_condicao = $condicao";
$resultado = ibase_query($consulta);
$registro = ibase_fetch_object($resultado);
$campo = $registro->$campo;
return $campo;
}
示例4: real
public function real($sql)
{
$this->connect();
$temp = \ibase_query($this->transaction !== null ? $this->transaction : $this->lnk, $sql);
if (!$temp) {
throw new DatabaseException('Could not execute query : ' . \ibase_errmsg() . ' <' . $sql . '>');
}
$this->aff = \ibase_affected_rows($this->lnk);
return $temp;
}
示例5: QueryObtieneDatos
protected function QueryObtieneDatos()
{
$this->AbreCnx();
//echo $this->query;
$rs = ibase_query($this->cnx, $this->query);
return $this->FetchAs($rs);
//var_dump($rs);
//echo $this->query;
unset($this->query);
$this->CierraCnx();
}
示例6: Buscar
function Buscar($q)
{
$conn = ibase_connect($this->src, $this->user, $this->password);
$query = "SELECT INVE03.CVE_ART, INVE03.DESCR FROM inve03 where INVE03.DESCR LIKE '%" . $q . "%' AND INVE03.STATUS='A' OR INVE03.CVE_ART LIKE '%" . $q . "%' AND INVE03.STATUS='A' ORDER BY INVE03.CVE_ART";
$inv = ibase_query($conn, $query);
print "<table width='100%' border='0' cellspacing='0' cellpadding='0' style='font-family:Verdana; font-size:10; font-color:#CDCD'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td></td>\n\t\t\t\t</tr>";
while ($IN = ibase_fetch_row($inv)) {
print "<tr>" . "<td>" . $IN[1] . "</td>" . "<td><input style='border:0; background-color: #f9f9f9; font-family:Verdana; font-size:10; font-color:#CDCD; cursor:pointer' type='submit' id='valor2' value='" . $IN[0] . "' onClick='Resultado(\"" . $IN[0] . "\");'/></td>" . "</tr>";
}
print "</table>";
}
示例7: executeQuery
public function executeQuery($sql)
{
try {
$this->openConnection();
$this->rtemp = ibase_query($this->connection, $sql);
while ($row = ibase_fetch_object($this->rtemp)) {
$this->result[] = $row;
}
$this->freeResult();
$this->closeConnection();
} catch (Exception $ex) {
$this->logger->log("Exception while connection with firebird database... {$ex}");
}
}
示例8: query
function query($query, $unbuffered = false)
{
$result = ibase_query($query, $this->_link);
if (!$result) {
$this->errno = ibase_errcode();
$this->error = ibase_errmsg();
return false;
}
$this->error = "";
if ($result === true) {
$this->affected_rows = ibase_affected_rows($this->_link);
return true;
}
return new Min_Result($result);
}
示例9: num_rows
/**
* Number of rows in the result set
*
* Firebird/Interbase doesn't have a graceful way to retun the number of rows
* so we have to use what amounts to a hack.
*
* @access public
* @return integer
*/
function num_rows()
{
if (!isset($this->sql)) {
return 0;
} else {
$stmt_temp = $this->sql;
$sth_temp = ibase_query($this->conn_id, $stmt_temp);
$row_count = 0;
while ($row_temp = ibase_fetch_object($sth_temp)) {
$row_count = $row_count + 1;
}
ibase_free_result($sth_temp);
return $row_count;
}
}
示例10: simpleQuery
function simpleQuery($query)
{
$ismanip = DB::isManip($query);
$this->last_query = $query;
$query = $this->modifyQuery($query);
$result = @ibase_query($this->connection, $query);
if (!$result) {
return $this->raiseError();
}
if ($this->autocommit && $ismanip) {
ibase_commit($this->connection);
}
// Determine which queries that should return data, and which
// should return an error code only.
return DB::isManip($query) ? DB_OK : $result;
}
示例11: deleteRow
function deleteRow($table, $params)
{
$sql = 'delete from ';
if (is_array($params)) {
foreach ($params as $fieldname => $id) {
$sql .= ' ' . $table;
$sql .= ' where ' . $fieldname . ' = ' . $id;
}
}
//return $sql;
$result = ibase_query($sql);
if ($result) {
return true;
} else {
return false;
}
}
示例12: DBAQuery
function DBAQuery(&$db, $database_file, $query)
{
if (!function_exists("ibase_connect")) {
return $db->SetError("DBA query", "Interbase support is not available in this PHP configuration");
}
if (!isset($db->options[$option = "DBAUser"]) || !isset($db->options[$option = "DBAPassword"])) {
return $db->SetError("DBA query", "it was not specified the Interbase {$option} option");
}
$database = $db->host . (strcmp($database_file, "") ? ":" . $database_file : "");
if (($connection = @ibase_connect($database, $db->options["DBAUser"], $db->options["DBAPassword"])) <= 0) {
return $db->SetError("DBA query", "Could not connect to Interbase server ({$database}): " . ibase_errmsg());
}
if (!($success = @ibase_query($connection, $query))) {
$db->SetError("DBA query", "Could not execute query ({$query}): " . ibase_errmsg());
}
ibase_close($connection);
return $success;
}
示例13: __construct
/**
* This function initializes the class.
*
* @access public
* @override
* @param DB_Connection_Driver $connection the connection to be used
* @param string $sql the SQL statement to be queried
* @param integer $mode the execution mode to be used
* @throws Throwable_SQL_Exception indicates that the query failed
*/
public function __construct(DB_Connection_Driver $connection, $sql, $mode = NULL)
{
$this->resource = $connection->get_resource();
$command = @ibase_query($this->resource, $sql);
if ($command === FALSE) {
throw new Throwable_SQL_Exception('Message: Failed to query SQL statement. Reason: :reason', array(':reason' => @ibase_errmsg()));
}
$this->command = $command;
$this->record = FALSE;
$this->blobs = array();
$count = (int) @ibase_num_fields($command);
for ($i = 0; $i < $count; $i++) {
$field = ibase_field_info($command, $i);
if ($field['type'] == 'BLOB') {
$this->blobs[] = $field['name'];
}
}
}
示例14: dbQuery
function dbQuery($query, $show_errors = true, $all_results = true, $show_output = true)
{
if ($show_errors) {
error_reporting(E_ALL);
} else {
error_reporting(E_PARSE);
}
// Connect to the Firebird/Interbase Sybase database management system
$link = ibase_pconnect("/var/www/sqlmap/dbs/firebird/testdb.fdb", "SYSDBA", "testpass");
if (!$link) {
die(ibase_errmsg());
}
// Print results in HTML
print "<html><body>\n";
// Print SQL query to test sqlmap '--string' command line option
//print "<b>SQL query:</b> " . $query . "<br>\n";
// Perform SQL injection affected query
$result = ibase_query($link, $query);
if (!$result) {
if ($show_errors) {
print "<b>SQL error:</b> " . ibase_errmsg() . "<br>\n";
}
exit(1);
}
print "<b>SQL results:</b>\n";
print "<table border=\"1\">\n";
while ($line = ibase_fetch_assoc($result)) {
// This must stay here for Firebird
if (!$show_output) {
exit(1);
}
print "<tr>";
foreach ($line as $col_value) {
print "<td>" . $col_value . "</td>";
}
print "</tr>\n";
if (!$all_results) {
break;
}
}
print "</table>\n";
print "</body></html>";
}
示例15: gcms_query
function gcms_query($query)
{
global $fbdb, $gcms_query_result, $gcms_trans_id;
$xid = $gcms_trans_id;
if (!$xid) {
gcms_trans();
}
$gcms_query_result = ibase_query($fbdb, $query);
if (!$xid) {
if ($gcms_query_result) {
gcms_commit();
} else {
gcms_rollback();
}
}
if (!$gcms_query_result) {
print "<br>" . $query . "<br><br>";
}
return $gcms_query_result;
}