本文整理汇总了PHP中sybase_query函数的典型用法代码示例。如果您正苦于以下问题:PHP sybase_query函数的具体用法?PHP sybase_query怎么用?PHP sybase_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sybase_query函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getQueryCount
public function getQueryCount($qtxt)
{
$link = $this->getDB();
$qtxt = iconv("utf-8", "gbk//ignore", $qtxt);
$query = sybase_query("exec llt_searchByPageCount " . "'" . $qtxt . "'", $link);
$row = sybase_fetch_array($query);
return $row[0];
}
开发者ID:blackjackedu,项目名称:FreeMLib,代码行数:8,代码来源:BookSearch.php
示例2: onConnect
/**
* Process connect events.
*
* @param var observable
* @param var dbevent
*/
public function onConnect($obs, $arg)
{
ini_set('sybct.min_server_severity', 0);
sybase_set_message_handler(array($this, '_msghandler'), $obs->handle);
sybase_query('set statistics io on', $obs->handle);
// Reset query- and message-cache
$this->queries = $this->messages = array();
}
开发者ID:melogamepay,项目名称:xp-framework,代码行数:14,代码来源:SybaseIOObserver.class.php
示例3: onConnect
/**
* Process connect events.
*
* @param var observable
* @param var dbevent
*/
public function onConnect($obs, $arg)
{
ini_set('sybct.min_server_severity', 0);
sybase_set_message_handler([$this, '_msghandler'], $obs->handle);
sybase_query('set showplan on', $obs->handle);
// Reset query- and message-cache
$this->queries = $this->messages = [];
}
开发者ID:xp-framework,项目名称:rdbms,代码行数:14,代码来源:SybaseShowplanObserver.class.php
示例4: _execute
protected function _execute()
{
$query = $this->_build_query();
if (!$query) {
return false;
}
$this->_result = @sybase_query($query, $this->_link);
if (!$this->_result) {
$this->_set_stmt_error(null, PDO::ERRMODE_SILENT, 'execute');
return false;
}
return true;
}
开发者ID:Deepab23,项目名称:clinic,代码行数:13,代码来源:sybase_statement.php
示例5: 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 Sybase database management system
$link = @sybase_pconnect("192.168.231.144", "testuser", "testpass");
if (!$link) {
die(sybase_get_last_message());
}
// Make 'testdb' the current database
$db_selected = @sybase_select_db("testdb");
if (!$db_selected) {
die(sybase_get_last_message());
}
// 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 = sybase_query($query);
if (!$result) {
if ($show_errors) {
print "<b>SQL error:</b> " . sybase_get_last_message() . "<br>\n";
}
exit(1);
}
if (!$show_output) {
exit(1);
}
print "<b>SQL results:</b>\n";
print "<table border=\"1\">\n";
while ($line = sybase_fetch_assoc($result)) {
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>";
}
开发者ID:dieface,项目名称:testenv,代码行数:47,代码来源:sybase_user.inc.php
示例6: select
function select($fields, $tables, $where = "", $order_by = "", $group_by = "", $having = "")
{
$sql_stat = " select {$fields} from {$tables} ";
if (!empty($where)) {
$sql_stat .= "where {$where} ";
}
if (!empty($group_by)) {
$sql_stat .= "group by {$group_by} ";
}
if (!empty($order_by)) {
$sql_stat .= "order by {$order_by} ";
}
if (!empty($having)) {
$sql_stat .= "having {$having} ";
}
$this->db_result = @sybase_query($sql_stat) or print "Error";
$this->db_affected_rows = @sybase_num_rows($this->db_result);
return $sql_stat;
}
开发者ID:rezarahimi4861,项目名称:icmf,代码行数:19,代码来源:sybase.php
示例7: _query
protected function _query($query)
{
global $configArray;
if (strcasecmp($configArray['System']['operatingSystem'], 'windows') == 0) {
return sybase_query($query);
} else {
return mssql_query($query);
}
}
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:9,代码来源:Horizon.php
示例8: query
function query($query)
{
//if flag to convert query from MySql syntax to Sybase syntax is true
//convert the query
if ($this->convertMySqlTosybaseQuery == true) {
$query = $this->ConvertMySqlTosybase($query);
}
// Initialise return
$return_val = 0;
// Flush cached values..
$this->flush();
// For reg expressions
$query = trim($query);
// Log how the function was called
$this->func_call = "\$db->query(\"{$query}\")";
// Keep track of the last query for debug..
$this->last_query = $query;
// Count how many queries there have been
$this->num_queries++;
// Use core file cache function
if ($cache = $this->get_cache($query)) {
return $cache;
}
// If there is no existing database connection then try to connect
if (!isset($this->dbh) || !$this->dbh) {
$this->connect($this->dbuser, $this->dbpassword, $this->dbhost);
$this->select($this->dbname);
}
// Perform the query via std sybase_query function..
$this->result = @sybase_query($query);
// If there is an error then take note of it..
if ($this->result == false) {
$get_errorcodeSql = "SELECT @@ERROR as errorcode";
$error_res = @sybase_query($get_errorcodeSql, $this->dbh);
$errorCode = @sybase_result($error_res, 0, "errorcode");
$get_errorMessageSql = "SELECT severity as errorSeverity, text as errorText FROM sys.messages WHERE message_id = " . $errorCode;
$errormessage_res = @sybase_query($get_errorMessageSql, $this->dbh);
if ($errormessage_res) {
$errorMessage_Row = @sybase_fetch_row($errormessage_res);
$errorSeverity = $errorMessage_Row[0];
$errorMessage = $errorMessage_Row[1];
}
$sqlError = "ErrorCode: " . $errorCode . " ### Error Severity: " . $errorSeverity . " ### Error Message: " . $errorMessage . " ### Query: " . $query;
$is_insert = true;
$this->register_error($sqlError);
$this->show_errors ? trigger_error($sqlError, E_USER_WARNING) : null;
return false;
}
// Query was an insert, delete, update, replace
$is_insert = false;
if (preg_match("/^(insert|delete|update|replace)\\s+/i", $query)) {
$this->rows_affected = @sybase_rows_affected($this->dbh);
// Take note of the insert_id
if (preg_match("/^(insert|replace)\\s+/i", $query)) {
$identityresultset = @sybase_query("select SCOPE_IDENTITY()");
if ($identityresultset != false) {
$identityrow = @sybase_fetch_row($identityresultset);
$this->insert_id = $identityrow[0];
}
}
// Return number of rows affected
$return_val = $this->rows_affected;
} else {
// Take note of column info
$i = 0;
while ($i < @sybase_num_fields($this->result)) {
$this->col_info[$i] = @sybase_fetch_field($this->result);
$i++;
}
// Store Query Results
$num_rows = 0;
while ($row = @sybase_fetch_object($this->result)) {
// Store relults as an objects within main array
$this->last_result[$num_rows] = $row;
$num_rows++;
}
@sybase_free_result($this->result);
// Log number of rows the query returned
$this->num_rows = $num_rows;
// Return number of rows selected
$return_val = $this->num_rows;
}
// disk caching of queries
$this->store_cache($query, $is_insert);
// If debug ALL queries
$this->trace || $this->debug_all ? $this->debug() : null;
return $return_val;
}
开发者ID:BGCX067,项目名称:ezsqlhelper-svn-to-git,代码行数:88,代码来源:ez_sql_sybase.php
示例9: query0
/**
* Execute any statement
*
* @param string sql
* @param bool buffered default TRUE
* @return rdbms.sybase.SybaseResultSet or TRUE if no resultset was created
* @throws rdbms.SQLException
*/
protected function query0($sql, $buffered = TRUE)
{
if (!is_resource($this->handle)) {
if (!($this->flags & DB_AUTOCONNECT)) {
throw new SQLStateException('Not connected');
}
$c = $this->connect();
// Check for subsequent connection errors
if (FALSE === $c) {
throw new SQLStateException('Previously failed to connect');
}
}
if (!$buffered) {
$result = @sybase_unbuffered_query($sql, $this->handle, FALSE);
} else {
if ($this->flags & DB_UNBUFFERED) {
$result = @sybase_unbuffered_query($sql, $this->handle, $this->flags & DB_STORE_RESULT);
} else {
$result = @sybase_query($sql, $this->handle);
}
}
if (FALSE === $result) {
$message = 'Statement failed: ' . trim(sybase_get_last_message()) . ' @ ' . $this->dsn->getHost();
if (!is_resource($error = sybase_query('select @@error', $this->handle))) {
// The only case selecting @@error should fail is if we receive a
// disconnect. We could also check on the warnings stack if we can
// find the following:
//
// Sybase: Client message: Read from SQL server failed. (severity 78)
//
// but that seems a bit errorprone.
throw new SQLConnectionClosedException($message, $sql);
}
$code = current(sybase_fetch_row($error));
switch ($code) {
case 1205:
// Deadlock
throw new SQLDeadlockException($message, $sql, $code);
default:
// Other error
throw new SQLStatementFailedException($message, $sql, $code);
}
}
return TRUE === $result ? $result : new SybaseResultSet($result, $this->tz);
}
开发者ID:Gamepay,项目名称:xp-framework,代码行数:53,代码来源:SybaseConnection.class.php
示例10: rollBack
public function rollBack()
{
parent::rollback();
if (!sybase_query('ROLLBACK', $this->link)) {
$this->set_driver_error(null, PDO::ERRMODE_EXCEPTION, 'rollBack');
}
$this->setAttribute(PDO::ATTR_AUTOCOMMIT, $this->driver_options[PDO::ATTR_AUTOCOMMIT]);
return true;
}
开发者ID:Deepab23,项目名称:clinic,代码行数:9,代码来源:sybase.php
示例11: query_sybase
function query_sybase($query)
{
if (!$this->sybase_link) {
return false;
}
$this->query_result = sybase_query($query, $this->sybase_link);
if ($this->query_result) {
return $this->query_result;
} else {
print nl2br("Error query. \n");
return false;
}
}
开发者ID:laiello,项目名称:cartonbank,代码行数:13,代码来源:phpMM_V_23_08_2007.php
示例12: die
<?php
//phpinfo();
$link = @sybase_connect('lltang2000', 'sa', '******') or die("Could not connect !");
//连接数据库,第一空必须写服务名称,不能是ip;
echo "Connected successfully<br>";
$db = @sybase_select_db("sulcmis", $link) or die("数据库没有选择");
echo "数据库选择成功<br>";
$sql = "select ctrlNo,F200,F210c from b_brief where ctrlNo<100";
$rs = sybase_query($sql, $link);
//查询表
if (!$rs) {
echo "SQL:" . $sql . "执行失败!";
exit;
}
//$sybase = sybase_fetch_array($rs);
//print_r($sybase);//结束
echo '<table border="1"><tr><td>CtrlNO</td><td>F200</td><td>F210c</td>';
while ($row = sybase_fetch_array($rs)) {
$id = $row["ctrlNo"];
$F200 = $row["F200"];
$F210c = $row["F210c"];
echo '<tr><td>' . $id . '</td><td>' . $F200 . '</td><td>' . $F210c . '</td></tr>';
}
echo '</table>';
sybase_free_result($rs);
sybase_close($link);
?>
开发者ID:blackjackedu,项目名称:FreeMLib,代码行数:28,代码来源:index.php
示例13: sybase_connect
<html>
<body bgcolor=white>
<?php
$dbproc = sybase_connect("JDBC", "guest", "sybase");
if (!$dbproc) {
return;
}
$res = sybase_query("select * from test", $dbproc);
if (!$res) {
return;
}
while ($arr = sybase_fetch_array($res)) {
print $arr["i"] . " " . $arr["v"] . "<br>\n";
}
?>
</body>
</html>
开发者ID:johnnyzhong,项目名称:freetds,代码行数:17,代码来源:test.php
示例14: sybase_query
$intention = $med[Intention];
$protocole = $med[Protocole];
$Tstage = $med[Code1];
$Nstage = $med[Code2];
$Mstage = $med[Code3];
$stage = $med[Code4];
$ptpn = $med[Code5];
//requete sur la partie CodeDiag
$queryDIAG = "SELECT * FROM CodeDiag\n\t\t\tWHERE (CodeDiag.DiagCode='{$Diag}')";
$requeteDIAG = sybase_query($queryDIAG, $link);
//while($co=sybase_fetch_array($requeteDIAG)) {
$co = sybase_fetch_array($requeteDIAG);
$DiagT = $co[1];
//requete sur la partie CodeRegion
$queryREG = "SELECT * FROM CodeRegion\n\t\t\tWHERE (CodeRegion.RegionCode='{$Region}')";
$requeteREG = sybase_query($queryREG, $link);
//while($re=sybase_fetch_array($requeteREG)) {
$re = sybase_fetch_array($requeteREG);
$RegT = $re[RegionText];
sybase_close($link);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" class="textprint" height="65">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%"><img src="../images/UCL.jpg" width="70" height="105"></td>
<td><p><b><font size="3" face="Verdana, Arial, Helvetica, sans-serif">Université catholique de Louvain<br>
</font></b> <font size="3"><b><font face="Verdana, Arial, Helvetica, sans-serif">Cliniques Universitaire Saint-Luc</font></b></font><br>
<font size="1">association sans but lucratif</font></p>
开发者ID:lynch829,项目名称:iTP,代码行数:31,代码来源:workflowPrescription.php
示例15: _sybase_field_flags
/**
* Get the flags for a field
*
* Currently supports:
* + <samp>unique_key</samp> (unique index, unique check or primary_key)
* + <samp>multiple_key</samp> (multi-key index)
*
* @param string $table the table name
* @param string $column the field name
*
* @return string space delimited string of flags. Empty string if none.
*
* @access private
*/
function _sybase_field_flags($table, $column)
{
static $tableName = null;
static $flags = array();
if ($table != $tableName) {
$flags = array();
$tableName = $table;
/* We're running sp_helpindex directly because it doesn't exist in
* older versions of ASE -- unfortunately, we can't just use
* DB::isError() because the user may be using callback error
* handling. */
$res = @sybase_query("sp_helpindex {$table}", $this->connection);
if ($res === false || $res === true) {
// Fake a valid response for BC reasons.
return '';
}
while (($val = sybase_fetch_assoc($res)) !== false) {
if (!isset($val['index_keys'])) {
/* No useful information returned. Break and be done with
* it, which preserves the pre-1.7.9 behaviour. */
break;
}
$keys = explode(', ', trim($val['index_keys']));
if (sizeof($keys) > 1) {
foreach ($keys as $key) {
$this->_add_flag($flags[$key], 'multiple_key');
}
}
if (strpos($val['index_description'], 'unique')) {
foreach ($keys as $key) {
$this->_add_flag($flags[$key], 'unique_key');
}
}
}
sybase_free_result($res);
}
if (array_key_exists($column, $flags)) {
return implode(' ', $flags[$column]);
}
return '';
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:55,代码来源:sybase.php
示例16: GetLastInsertID
function GetLastInsertID($sTable)
{
$res = sybase_query('SELECT @@identity', $this->conn);
if ($res) {
$Record = @sybase_fetch_array($res);
sybase_free_result($res);
return $Record[0];
}
trigger_error('Could not retrieve @@identity of newly inserted record!!');
return -1;
}
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:11,代码来源:class.DCL_DB_sybase.inc.php
示例17: simpleQuery
function simpleQuery($query)
{
$this->last_query = $query;
$query = $this->modifyQuery($query);
$result = @sybase_query($query, $this->connection);
if (!$result) {
return $this->raiseError();
}
// Determine which queries that should return data, and which
// should return an error code only.
return DB::isManip($query) ? DB_OK : $result;
}
开发者ID:joeymetal,项目名称:v1,代码行数:12,代码来源:sybase.php
示例18: simpleQuery
/**
* Send a query to Sybase and return the results as a Sybase resource
* identifier.
*
* @param the SQL query
*
* @access public
*
* @return mixed returns a valid Sybase result for successful SELECT
* queries, DB_OK for other successful queries. A DB error is
* returned on failure.
*/
function simpleQuery($query)
{
$this->last_query = $query;
$query = $this->modifyQuery($query);
$result = @sybase_query($query, $this->connection);
if (!$result) {
return $this->sybaseRaiseError();
}
if (is_resource($result)) {
$numrows = $this->numRows($result);
if (is_object($numrows)) {
return $numrows;
}
$this->num_rows[$result] = $numrows;
return $result;
}
// Determine which queries that should return data, and which
// should return an error code only.
return DB::isManip($query) ? DB_OK : $result;
}
开发者ID:noikiy,项目名称:owaspbwa,代码行数:32,代码来源:sybase.php
示例19: currentid
function currentid($seq_name)
{
$this->connect();
$currentid = 0;
$q = sprintf("select nextid from %s where seq_name = '%s'", $this->Seq_Table, $seq_name);
$id = @sybase_query($q, $this->Link_ID);
$res = @sybase_fetch_array($id);
/* No current value, make one */
if (is_array($res)) {
$currentid = $res["nextid"];
}
return $currentid;
}
开发者ID:antirek,项目名称:prestige-pbx,代码行数:13,代码来源:phplib_sybase.php
示例20: getMyFines
/**
* Get Patron Fines
*
* This is responsible for retrieving all fines by a specific patron.
*
* @param array $patron The patron array from patronLogin
*
* @throws \VuFind\Exception\Date
* @throws ILSException
* @return mixed Array of the patron's fines on success.
*/
public function getMyFines($patron)
{
$aid = $patron['address_id_nr'];
$iln = $patron['iln'];
//$lang = $patron['lang'];
$sql = "select o.ppn" . ", r.costs_code" . ", r.costs" . ", rtrim(convert(char(20),r.date_of_issue,104))" . ", rtrim(convert(char(20),r.date_of_creation,104))" . ", 'Overdue' as fines" . ", o.shorttitle" . " from requisition r, ous_copy_cache o, volume v" . " where r.address_id_nr=" . $aid . "" . " and r.iln=" . $iln . " and r.id_number=v.volume_number" . " and v.epn=o.epn" . " and r.iln=o.iln" . " and r.costs_code in (1, 2, 3, 4, 8)" . " union select id_number" . ", r.costs_code" . ", r.costs" . ", rtrim(convert(char(20),r.date_of_issue,104))" . ", rtrim(convert(char(20),r.date_of_creation,104))" . ", r.extra_information" . ", '' as zero" . " from requisition r" . " where r.address_id_nr=" . $aid . "" . " and r.costs_code not in (1, 2, 3, 4, 8)" . "";
try {
$result = [];
$sqlStmt = sybase_query($sql);
while ($row = sybase_fetch_row($sqlStmt)) {
//$fine = $this->translate(('3'==$row[1])?'Overdue':'Dues');
$fine = $this->picaRecode($row[5]);
$amount = null == $row[2] ? 0 : $row[2] * 100;
//$balance = (null==$row[3])?0:$row[3]*100;
$checkout = substr($row[3], 0, 12);
$duedate = substr($row[4], 0, 12);
$title = $this->picaRecode(substr($row[6], 0, 12));
$result[] = ['id' => $this->prfz($row[0]), 'amount' => $amount, 'balance' => $amount, 'checkout' => $checkout, 'duedate' => $duedate, 'fine' => $fine, 'title' => $title];
}
return $result;
} catch (\Exception $e) {
throw new ILSException($e->getMessage());
}
return [];
}
开发者ID:tillk,项目名称:vufind,代码行数:36,代码来源:LBS4.php
注:本文中的sybase_query函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论