Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function connectToDatabase(){
- $username = 'test';
- $password = 'test';
- $ora_host='(DESCRIPTION =(ADDRESS =(PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))(CONNECT_DATA =(SID = ora01)))';
- $connect = ocilogon($username, $password, $ora_host,"AL32UTF8");
- return $connect;
- }
- public function getAllEvents()
- {
- $connect = $this->connectToDatabase();
- //текст запроса
- $q="SELECT tnodid, tnodparentid, tnodcaption FROM treenodes where TNODPARENTID='5797357' and TNODVISIBLE=1";
- //сформировать запрос
- $query = ociparse($connect, $q);
- //выполнить запрос
- oci_execute($query,OCI_DEFAULT);
- while ($get_result = oci_fetch_assoc($query)){
- $result[] = $get_result;
- }
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement