Languages :: PHP :: Display rows from Oracle database in PHP |
|||
| By: FiatLink |
Date: 25/11/2004 11:19:02 |
Points: 20 | Status: Answered Quality : Excellent |
|
hello, I have one sql statement (implicit join), when i run this statement at sql*plus this gives me some result and when i want this sql statement to run through PHP then it is not returning me, because i don't know how to display. here is my code <? $str= "SELECT r.TABLE_NAME as T1 FROM USER_CONSTRAINTS p, USER_CONSTRAINTS r WHERE p.TABLE_NAME = '$table_name' and p.CONSTRAINT_TYPE IN ('P','U') and r.R_CONSTRAINT_NAME = p.CONSTRAINT_NAME and r.CONSTRAINT_TYPE = 'R' UNION SELECT p.TABLE_NAME as T2 FROM USER_CONSTRAINTS p,USER_CONSTRAINTS r where r.TABLE_NAME ='$table_name' and p.CONSTRAINT_TYPE IN ('P','U') AND r.R_CONSTRAINT_NAME = p.CONSTRAINT_NAME and r.CONSTRAINT_TYPE = 'R' "; $tmp = ociparse($connection, $str); ociexecute($tmp,OCI_DEFAULT); $i = 0; while (ocifetch($tmp)) { $table_name[$i] = ociresult($tmp,"TABLE_NAME"); // i think problem is here print " table name is ".$table_name[$i]." "; // here i am not getting any result $i++; } ocifreestatement($tmp); ?> thank you |
|||
| By: Bernard | Date: 25/11/2004 11:20:38 | Type : Answer |
|
| you may try : $table_name[$i]['TABLE_NAME'] = ociresult($tmp,'TABLE_NAME'); |
|||
| By: Bernard | Date: 03/12/2004 09:33:21 | Type : Comment |
|
| any news from this ? | |||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








