外掛程式62 從表中讀取資訊

2021-06-02 00:46:55 字數 1292 閱讀 2504

<?php // plug-in 62: get user from db

/* * 外掛程式說明:

* 根據提供的表名和使用者名稱,外掛程式將讀取這個使用者的記錄並返回給呼叫程式。

* 若操作成功,則返回乙個兩元素的陣列,其中第乙個元素的值為true,而第二個元素是乙個陣列,儲存使用者的各項資料。

* 若操作失敗,則返回乙個元素陣列,這個元素的值為false.

* 他需要的引數:

* $table 資料表名。

* $handle 使用者名稱。

*/// this is an executable example with additional code supplied

// to obtain just the plug-ins please click on the download link

$dbhost = 'localhost'; // normally no need to change this

$dbname = 'piphp'; // change to your database name

$dbuser = 'root'; // change to your database user name

$dbpass = 'xiaonan'; // change to your database password

mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());

mysql_select_db($dbname) or die(mysql_error());

$table = 'users';

$handle = 'firstprez';

$result = piphp_getuserfromdb($table, $handle);

echo "";

if ($result[0] == false) echo "lookup failed.";

else echo "name = " . $result[1][0] . "

" . "handle = " . $result[1][1] . "

" . "pass(salted) = " . $result[1][2] . "

" . "email = " . $result[1][3];

function piphp_getuserfromdb($table, $handle)

?>

從txt讀取資訊然後儲存到excel中示例

一 導包 實現這個功能需要poi的包需要將jar包匯入 org.apache.poi poi3.17 beta1 二 示例 讀取txt將資料儲存到excel param args public static void main string args if jsonobject1.containsk...

sql儲存過程讀取資訊中問題

sql select from select top 4 id,smallpic,newsnamesi,enddate,contentsi,sortid from achi news where productproperty 1 and isok 1 and homeforcepage 1 and...

從 IE 中讀取 Cookie 資訊

從 ie 中讀取 cookie 資訊 我們首先正常登入到系統中,就會在客戶端產生正常的 cookie 資訊。需要引用兩個 com 元件 1 micrisoft internet controls 1.1,即 shdocvw。這個元件,如果在指令碼中執行時,直接匯入 c windows system3...