visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
316 experts, 1194 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: PHP :: Display rows from Oracle database in PHP


By: FiatLink Belgium  Date: 25/11/2004 11:19:02  English  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 English  Type : Answer
you may try :

$table_name[$i]['TABLE_NAME'] = ociresult($tmp,'TABLE_NAME');
By: Bernard Date: 03/12/2004 09:33:21 English  Type : Comment
any news from this ?

Do register to be able to answer

EContact
browser fav
page generated in 238.256930 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page