Categories
Copy_N_Paste Programming/php

[PHP] Native SQLRELAY connect / query sample code

Categories
JOB System/Linux/Unix*

Protected: sqlrelay server install steps

There is no excerpt because this is a protected post.

Categories
Copy_N_Paste DATABASE Programming/php

sqlrelay sample code / prepare statement / bind value 寫法

include dirname(__FILE__) . ‘/local_config.php’; $__oradb=_fn_connect_sqlrelay(); $__oradb->setOption(‘portability’, DB_PORTABILITY_LOWERCASE); $sql = ‘ select g_no,ctrl_rowid,g_storage,g_img from goods_file where g_no=? ‘; foreach ( $items as $g_no => $v ) { $prepare = $__oradb->prepare($sql); $result = $__oradb->execute($prepare,$g_no); if ( $result ) { $row = $result->fetchRow(DB_FETCHMODE_ASSOC); $items[ $g_no ][‘ctrl_rowid’] = $row[‘ctrl_rowid’]; $items[ $g_no ][‘g_storage’] = $row[‘g_storage’]; $items[ $g_no ][‘g_img’] = $row[‘g_img’]; […]

Categories
DATABASE JOB Programming/misc Software System/Linux/Unix*

Protected: sqlrelay server install / setup / SOP / 設定 / 啟動

There is no excerpt because this is a protected post.

Categories
JOB Software System/Linux/Unix*

sqlrelay client for php and C : install / settings / history / tunning 方法

2017-0920 update: stable version = rudiments-0.32  + sqlrelay-0.39.4 ./sqlrelay-0.39.4/src/api/php/.libs/libsql_relay.so.0.0.0     step1. 裝 sqlrelay 前要先裝 Rudiments 的 library , 現在抓 rudiments 0.32 版. fetch source : http://downloads.sourceforge.net/rudiments/rudiments-0.32.tar.gz?modtime=1231398532&big_mirror=0 configure , make , make install PATH=”$PATH:/sbin” ldconfig -n /usr/local/firstworks/lib Libraries have been installed in: /usr/local/firstworks/lib 他有提到幾點 – add LIBDIR to the `LD_LIBRARY_PATH’ environment variable during execution – […]

Categories
Copy_N_Paste DATABASE Programming/php

oracle/sqlrelay/php 把 field 的 name 轉成小寫 sample code

// $__oradb->setOption(‘portability’, DB_PORTABILITY_LOWERCASE); require_once “config.php”; require_once “sqlrelay.php”; unset($__config[‘sqlrelay_dsn’]); $__config[‘sqlrelay_dsn’][]=”sqlrelay://xx_id:xx_pass@172.30.0.17:9000″; $sql=”select aaa,bbb from xxxx t where g_close_date is null”; $__now=get_microtime(); $__oradb=_fn_connect_sqlrelay(); $__oradb->setOption(‘portability’, DB_PORTABILITY_LOWERCASE); $result = $__oradb->query($sql); if (DB::isError($result)) { echo “db error\n”; printf(“Execution time : %s\n”,get_microtime()-$__now); exit; } while ( $row=$result->fetchRow(DB_FETCHMODE_ASSOC) ) { // —– echo $row[‘aaa’] . ‘ : ‘ . $row[‘bbb’]; } $result->free(); $__oradb->disconnect(); […]