// Start table definition
$ T_data = "zl_t_data ";
$ T_data_class = $ t_data. "_ class ";
$ T_data_keyword = $ t_data. "_ keyword ";
// Define the end of the table
Class odbc_oracle
{
VaR $ host = "php_oracle"; // defines the ODBC Data Source
VaR $ user = "soohuo"; // define the user name
VaR $ passwd = "soohuo"; // defines the password.
// Database connection
Function connect ()
{
$ Con = odbc_connect ($ this-> host, $ this-> User, $ this-> passwd );
If (! $ Con)
{
Echo "ODBC is not connect!
";
Exit ();
}
// Odbc_autocommit ($ con );
Return $ con;
}
// SQL statement execution
Function query ($ con, $ SQL)
{
If (empty ($ con ))
{
Echo "ODBC connect success value is not null!
";
Exit ();
}
If (empty ($ SQL ))
{
Echo "odbc SQL value is not null!
";
Exit ();
}
$ Result = odbc_do ($ con, $ SQL );
Return $ result;
}
// Handle for successful execution. The parameter is the handle after the SQL statement is executed.
Function fetch_row ($ result)
{
If (empty ($ result ))
{
Echo "ODBC query success is null!
";
Exit ();
}
$ ROW = odbc_fetch_row ($ result );
// If (! $ Row)
//{
// Echo "ODBC query error!
";
// Exit ();
//}
Return $ row;
}
// Close the database. The parameter is the connection handle.
Function close ($ con)
{
If (empty ($ con ))
{
Echo "ODBC connect is not null!
";
Exit ();
}
Odbc_close ($ con );
}
}
?>