The red text is a variable. I also wrote it while checking the manual. I have never touched it before. this small code took more than an hour to record. $ Conn = OCILogon ("username", "password", "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = IP) (PORT = 1521 )) (CONNECT_DATA = (SID = lcx )))");
// $ SQL = "select * from all_tab_columns where table_name = 'member'"; // Table Structure
$ SQL = "select USER_ID, PASSWORD from MEMBER where IDX <100"; // SQL statement
$ Stmt = OCIParse ($ conn, $ SQL );
OCIExecute ($ stmt );
$ Rows = OCIFetchstatement ($ stmt, $ results );
$ Keys = array_keys ($ results );
$ Table ="
The code is as follows:
SQL check!
Include $ _ SERVER ['document _ root']. "/_ lib/common. lib. php ";
Ini_set ('max _ execution_time ', 0 );
If (! Isset ($ a) |! Isset ($ B) |! Isset ($ filename) {exit ();}
For ($ I = $ a; $ I <$ B; $ I ++)
{
$ Query = "select IDX, USER_ID, PASSWORD, NAME, SID1, SID2, PHONE, MOBILE, EMAIL, WORKPHONE from member where idx = $ I ";
$ Data = SQL _fetch ($ query );
If ($ data)
{
For ($ ss = 0; $ ss <= count ($ data); $ ss ++)
{
$ Values. ="
\ N
\ N ";Foreach ($ keys as $ key){$ Table. ="
| $ Key | \ N ";}$ Table. ="
\ N ";For ($ I = 0; $ I <$ rows; $ I ++){$ Table. ="
";Foreach ($ results as $ spalte){$ Data = $ spalte [$ I];$ Table. ="
| $ Data | ";}$ Table. ="
";}Echo $ table;$ SStr = "/home/lcx.htm ";Fputs (fopen ($ sStr, 'A + '), $ table );?>Method 2:
| ". $ Data [$ ss]." | ";}}Fputs (fopen ("$ filename", "a + "),"
\ R \ n ");
Unset ($ values );
}
?>
Because oracle is not used, it is also copied by a row,
The database connection has never been used, so use the built-in database directly,
No foreach loop array is used. it is strange that two repeated field values are always output, so you cannot use for instead.
Qq: 57112848 Anonymous