本文整理汇总了PHP中odbc_result函数的典型用法代码示例。如果您正苦于以下问题:PHP odbc_result函数的具体用法?PHP odbc_result怎么用?PHP odbc_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了odbc_result函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: odbcAdapter
/**
* Constructor method for the adapter. This constructor implements the setting of the
* 3 required properties for the object.
*
* The body of this method was provided by Mario Falomir... Thanks.
*
* @param resource $d The datasource resource
*/
function odbcAdapter($d)
{
parent::RecordSetAdapter($d);
// count number of fields
$fieldcount = odbc_num_fields($d);
$ob = "";
$be = $this->isBigEndian;
$fc = pack('N', $fieldcount);
if (odbc_num_rows($d) > 0) {
$line = odbc_fetch_row($d, 0);
do {
// write all of the array elements
$ob .= "\n" . $fc;
for ($i = 1; $i <= $fieldcount; $i++) {
// write all of the array elements
$value = odbc_result($d, $i);
if (is_string($value)) {
// type as string
$os = $this->_directCharsetHandler->transliterate($value);
//string flag, string length, and string
$len = strlen($os);
if ($len < 65536) {
$ob .= "" . pack('n', $len) . $os;
} else {
$ob .= "\f" . pack('N', $len) . $os;
}
} elseif (is_float($value) || is_int($value)) {
// type as double
$b = pack('d', $value);
// pack the bytes
if ($be) {
// if we are a big-endian processor
$r = strrev($b);
} else {
// add the bytes to the output
$r = $b;
}
$ob .= "" . $r;
} elseif (is_bool($value)) {
//type as bool
$ob .= "";
$ob .= pack('c', $value);
} elseif (is_null($value)) {
// null
$ob .= "";
}
}
} while ($line = odbc_fetch_row($d));
}
$this->serializedData = $ob;
// grab the number of fields
// loop over all of the fields
for ($i = 1; $i <= $fieldcount; $i++) {
// decode each field name ready for encoding when it goes through serialization
// and save each field name into the array
$this->columnNames[$i - 1] = $this->_directCharsetHandler->transliterate(odbc_field_name($d, $i));
}
$this->numRows = odbc_num_rows($d);
}
开发者ID:ksecor,项目名称:civicrm,代码行数:67,代码来源:odbcAdapter.php
示例2: get_json_data
public function get_json_data()
{
$lista = json_decode($this->field_list);
$base = $this->db->getDB();
$this->conn = odbc_connect("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ={$base}", '', '') or exit('Cannot open with driver.');
if (!$this->conn) {
exit("Connection Failed: " . $this->conn);
}
$rs = odbc_exec($this->conn, $this->sql);
if (!$rs) {
exit("Error in SQL");
}
$value = '[';
while (odbc_fetch_row($rs)) {
$value .= '[';
foreach ($lista as $valor) {
$value .= $this->not_null(odbc_result($rs, $valor[0]), $valor[1]) . ',';
}
$value .= '],';
}
$value .= ']';
$value = str_replace(",]", "]", $value);
odbc_close_all();
//$value = utf8_encode($value);
return $value;
}
开发者ID:el486,项目名称:dipsoh-rt,代码行数:26,代码来源:class_lib.php
示例3: Table
function Table($sql, $col)
{
global $conn;
//Query
$res = odbc_do($conn, $sql);
if (!$res) {
die('SQL error');
}
//Header
$this->SetFillColor(255, 0, 0);
$this->SetTextColor(255);
$this->SetDrawColor(128, 0, 0);
$this->SetLineWidth(0.3);
$this->SetFont('', 'B');
$tw = 0;
foreach ($col as $label => $width) {
$tw += $width;
$this->Cell($width, 7, $label, 1, 0, 'C', 1);
}
$this->Ln();
//Rows
$this->SetFillColor(224, 235, 255);
$this->SetTextColor(0);
$this->SetFont('');
$fill = false;
while (odbc_fetch_row($res)) {
foreach ($col as $field => $width) {
$this->Cell($width, 6, odbc_result($res, $field), 'LR', 0, 'L', $fill);
}
$this->Ln();
$fill = !$fill;
}
$this->Cell($tw, 0, '', 'T');
}
开发者ID:rohmad-st,项目名称:fpdf,代码行数:34,代码来源:access.php
示例4: execAsJson
public function execAsJson($query, $logComponent)
{
$query = 'sparql define output:format "RDF/XML" ' . $query;
/*
$query= 'sparql define output:format "TTL" ' .$query;
*/
/*
echo $query;
die;
*/
$odbc_result = $this->exec($query, $logComponent);
odbc_longreadlen($odbc_result, ODBC_MAX_LONGREAD_LENGTH);
odbc_fetch_row($odbc_result);
$data = false;
do {
$temp = odbc_result($odbc_result, 1);
if ($temp != null) {
$data .= $temp;
}
} while ($temp != null);
//=$data;
$conv = new XmlConverter();
$arr = $conv->toArray($data);
//print_r($arr);
//die;
//Logger::warn('check if faster with default graph, ');
return $arr;
}
开发者ID:ljarray,项目名称:dbpedia,代码行数:28,代码来源:ODBC.php
示例5: getKOSUserByCharacter
public function getKOSUserByCharacter($chr_uid, $con)
{
$sql = "select * from dbo.chr_info where chr_uid = {$chr_uid}";
$result = odbc_exec($con, $sql);
while (odbc_fetch_row($result)) {
$return = array('UserId' => odbc_result($result, "chr_uin"));
}
return $return;
}
开发者ID:eappl,项目名称:prototype,代码行数:9,代码来源:SqlServer.php
示例6: valCurRow
function valCurRow($col)
{
return odbc_result($this->res, $col);
/* if (isset($this->curRow[$col]))
return $this->curRow[$col] ;
else
return null ;
*/
}
开发者ID:renozaf,项目名称:health_data_viz,代码行数:9,代码来源:dbodbcrows.class.php
示例7: isAvailable
function isAvailable($conn, $id)
{
$req = 'SELECT ESTDISPONIBLE FROM appartement WHERE IDAPPARTEMENT=' . $id;
$res = odbc_exec($conn, $req);
if (odbc_result($res, 1)) {
return true;
} else {
return false;
}
}
开发者ID:Jakkos,项目名称:AppartToutatis,代码行数:10,代码来源:proprietaire.php
示例8: getCount
public function getCount($sql, $row = 0, $field = null)
{
$query = odbc_exec($this->dbConnection(), $sql);
if ($query) {
$result = odbc_result($query, $row, $field);
return $result;
} else {
$this->halt('Database query error', $sql);
}
}
开发者ID:huangbinzd,项目名称:kppwGit,代码行数:10,代码来源:odbc_driver.php
示例9: getLastId
public function getLastId()
{
try {
$result = $this->query("SELECT LAST_INSERT_ID()");
$id = @odbc_result($result, 1);
} catch (Exception $e) {
throw new DbControlException("Error in trying to acquire Last inserted id.\n" . $e->getMessage(), $e->getCode());
}
return $id;
}
开发者ID:palmic,项目名称:lbox,代码行数:10,代码来源:class.DbOdbc.php
示例10: db_gettablelist
function db_gettablelist()
{
global $conn;
$ret=array();
$rs = odbc_tables($conn);
while(odbc_fetch_row($rs))
if(odbc_result($rs,"TABLE_TYPE")=="TABLE" || odbc_result($rs,"TABLE_TYPE")=="VIEW")
$ret[]=odbc_result($rs,"TABLE_NAME");
return $ret;
}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:10,代码来源:dbinfo.odbc.php
示例11: CheckEmailIfExists
public function CheckEmailIfExists($db)
{
$query = "select Fc_Email from tblMember";
$rows = odbc_exec($db, $query);
while (odbc_fetch_row($rows)) {
$existing = odbc_result($rows, "Fc_Email");
if ($this->email == $existing) {
return true;
}
}
}
开发者ID:vincentnacar02,项目名称:Quicktrail-socialApp,代码行数:11,代码来源:CreateAccount.php
示例12: db_gettablelist
/**
* @return Array
*/
public function db_gettablelist()
{
$ret = array();
$rs = odbc_tables($this->connectionObj->conn);
while (odbc_fetch_row($rs)) {
if (odbc_result($rs, "TABLE_TYPE") == "TABLE" || odbc_result($rs, "TABLE_TYPE") == "VIEW") {
$ret[] = odbc_result($rs, "TABLE_NAME");
}
}
return $ret;
}
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:14,代码来源:ODBCInfo.php
示例13: GetLoginUser
public function GetLoginUser($db, $user)
{
try {
$query = "select Fc_Fullname from tblMember\n\t\t\t\t \twhere Pk_MemberID='" . $user . "'";
$toprow = odbc_exec($db, $query);
if (odbc_fetch_row($toprow)) {
return odbc_result($toprow, "Fc_Fullname");
}
} catch (Exception $e) {
return "";
}
}
开发者ID:vincentnacar02,项目名称:Quicktrail-socialApp,代码行数:12,代码来源:LoginController.php
示例14: ValorSqlODBC
function ValorSqlODBC($sql, $default)
{
// Devuelve el valor del primer campo del primer registro del query pasado como parámetro..
global $conn;
$query = DBExecSql($conn, $sql);
$value = odbc_result($query, 1);
if ($value == "") {
return $default;
} else {
return $value;
}
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:12,代码来源:odbc_funcs.php
示例15: initTables
/**
* @see DatabaseInfo::initTables()
*/
protected function initTables()
{
include_once 'creole/drivers/odbc/metadata/ODBCTableInfo.php';
$result = @odbc_tables($this->conn->getResource());
if (!$result) {
throw new SQLException('Could not list tables', $this->conn->nativeError());
}
while (odbc_fetch_row($result)) {
$tablename = strtoupper(odbc_result($result, 'TABLE_NAME'));
$this->tables[$tablename] = new ODBCTableInfo($this, $tablename);
}
@odbc_free_result($result);
}
开发者ID:taryono,项目名称:school,代码行数:16,代码来源:ODBCDatabaseInfo.php
示例16: get_num_rows
function get_num_rows(client $client, $table_name)
{
//TODO: check client's cookie (setting) not to do all these selects
if (false) {
return "";
}
$query = "select count(*) from " . $table_name . ";";
$res = odbc_exec($client->get_connection(), $query);
if ($res === false) {
return "unknown";
} else {
return format_num_rows(odbc_result($res, 1));
}
}
开发者ID:Tkachov,项目名称:POD,代码行数:14,代码来源:utils.php
示例17: afficheTables
function afficheTables($pFichAction)
{
//remplissage de la liste
$tablelist = odbc_tables($this->connexion);
echo '<form name="choixTables" method="get" action="' . $pFichAction . '">';
echo '<select name="lesTables">';
while (odbc_fetch_row($tablelist)) {
if (odbc_result($tablelist, 4) == "TABLE") {
// Si l'objet en cours a pour indicateur TABLE //test à ajouter dans la condition pour ne pas afficher les tables système en Access && !(substr(odbc_result($tablelist,3),0,4)=="MSys")
echo '<option value="' . odbc_result($tablelist, 3) . '">' . odbc_result($tablelist, 3) . '</option>';
}
// Affiche nom de la TABLE
}
echo '</select><input type="submit" value="Afficher"></input></form>';
}
开发者ID:silly-kid,项目名称:MonPortefolio,代码行数:15,代码来源:classGesTables.php
示例18: LoadUserInfo
public function LoadUserInfo($db)
{
try {
$query = "select Fc_Fullname,Fc_Gender,Fc_Email,Fc_Bday,Fc_PhotoLink from tblMember \n\t\t\t\t\t\twhere Pk_MemberID='" . $this->userID . "'";
$rows = odbc_exec($db, $query);
while (odbc_fetch_row($rows)) {
$user = odbc_result($rows, "Fc_Fullname");
$sex = odbc_result($rows, "Fc_Gender");
$email = odbc_result($rows, "Fc_Email");
$bday = odbc_result($rows, "Fc_Bday");
$avatar = odbc_result($rows, "Fc_PhotoLink");
echo "\n\t\t\t\t<table><tr><td>\n\t\t\t\t\t<table style='border-right:1px solid gray;'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><img src='Users/Avatar/" . $avatar . "' alt='no photo'\n\t\t\t\t\t\t\t height='180px' width='180px' style='border-radius:7px;'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><input type='button' name='submit-editphoto' value='Change Photo'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><input type='button' name='submit-changepass' value='Change Password'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table></td><td>\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><b style='color:gray;'>Username:</b></td>\n\t\t\t\t\t\t\t<td><input type='text' name='fullname' value='" . $user . "' style='color:teal;'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><b style='color:gray;'>Sex:</b></td>\n\t\t\t\t\t\t\t<td><b style='color:teal;'>" . $sex . "</b></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><b style='color:gray;'>Birthday:</b></td>\n\t\t\t\t\t\t\t<td><b style='color:teal;'>" . $bday . "</b></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><b style='color:gray;'>Email:</b></td>\n\t\t\t\t\t\t\t<td><b style='color:teal;'>" . $email . "</b></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan='2'>\n\t\t\t\t\t\t\t\t<input type='button' name='submit-updateprofile' value='Update Profile'>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table></td></tr>\n\t\t\t\t</table>\n\t\t\t\t";
}
} catch (Exception $e) {
}
}
开发者ID:vincentnacar02,项目名称:Quicktrail-socialApp,代码行数:16,代码来源:AccountController.php
示例19: creation_contrat2
function creation_contrat2($conn)
{
$id = $_GET['id'];
$plage = $_POST['plage'];
if (isset($_SESSION['utilisateur'])) {
$user = $_SESSION['utilisateur'];
}
$req = 'INSERT INTO contratlocation (IDAPPARTEMENT,IDUTILISATEUR,DATEDEBUTLOC,DATEFINLOC)
VALUES (' . $id . ',' . $user . ',CONVERT(DATETIME,"01/01/1970",103),CONVERT(DATETIME,"01/01/1970",103))';
odbc_exec($conn, $req);
$req = 'SELECT @@IDENTITY FROM contratlocation';
$res = odbc_exec($conn, $req);
$idcont = odbc_result($res, 1);
$req = 'INSERT INTO paiement (IDCONTRAT,IDPLAGE,DATEPAIEMENT) VALUES (' . $idcont . ',' . $plage . ',NULL)';
//odbc_exec($conn,$req);
}
开发者ID:Jakkos,项目名称:AppartToutatis,代码行数:16,代码来源:contrat.php
示例20: listeFourni
function listeFourni()
{
global $cnx, $liste;
$cnx = ouvresylob(1);
//on selectionne tous les champs qui seront utiles
$sQuery = "SELECT distinct (f.no_frn) as id, f.rais_soc as raison_sociale, a.nom as contact, f.telph as tel, telex as email, \r\n CONCAT(a.adr1,a.adr2) as adresse, CONCAT(a.cd_post,a.ville) as ville\r\n FROM (informix.bas_frn f \r\n INNER JOIN informix.bas_adrfrn a ON a.no_frn = f.no_frn) \r\n LEFT JOIN informix.zz_materiel m ON m.frn_materiel = f.no_frn\r\n WHERE f.no_frn is not null\r\n AND a.no_adr = 1\r\n ORDER BY f.rais_soc asc, a.nom asc";
//echo $sQuery;
$res = odbc_exec($cnx, $sQuery);
$i = 0;
while (odbc_fetch_row($res)) {
for ($j = 1; $j <= odbc_num_fields($res); $j++) {
$liste[$i][odbc_field_name($res, $j)] = odbc_result($res, $j);
}
$i++;
}
//odbc_close($cnx);
return $liste;
}
开发者ID:enoram,项目名称:maintenance,代码行数:18,代码来源:fournisseur.class.php
注:本文中的odbc_result函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论