470,848 Members | 1,690 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

OCIFetchStatement from joined tables

Hi,

I'm having a problem getting the values from an OCIFetchStatement.

Using the following codes, I'm geting the results from two table
joined and I have to print out the results in such a way that I get
my first row from table A and then the results of the table B which
have the same key just below row of table A. and this goes on.
The values are replaced into a template before being displayed:

$nb_rt = OCIFetchStatement($stmt,$results);
for ( $i = 0; $i < $nb_rt; $i++ )
{
if ($i < $MAX_ROWS_DISPLAYED)
{
reset($results);
$index_rt++;
if (($i == 9) || ($i == $nb_rt-1))
$un_rt_modif_htm = $un_rt_last_htm;
else
$un_rt_modif_htm = $un_rt_htm;
$j = 0;
$id_rt = "";
$index = "";
while ( $column = each($results) ) {
$j++;
$data = $column['value'];
if ($j == 1)
$id_rt = $data[$i];
else if ($j == 2)
$index = $id_rt."_".str_replace(" ", "", $data[$i]);

$champ_rt[$j] = "#" . $column['key'] . "#";
$un_rt_modif_htm = replace_champs($champ_rt[$j], $data[$i],
$un_rt_modif_htm);
}
}

I'm trying to put the results of table B into a second array called
resultsB, since it is in the select statement as from the 12th column,
which defined as:

for($abc=0; $abc < 12; $abc++)
{
$resultsB[$abc] = $results[$abc+11];
}

The problem is that I'm not geting the values in the resultsB using
the following:

$j = 0;
$index = "";
while ( $column = each($resultsB) ) {
$j++;
$data = $column['value'];
if ($j == 1)
$index = $data[$x];
else if (($j > 1) && ($j <= 6))
$index .= "_".str_replace(" ", "", $data[$x]);
else if($j == 7) {
if($data[$x] == "Réémis") {
$index .= "_r";
}
else {
$index .= "_n";
}
}
}
I really don't know why it's not getting the values from resultsB.

Any suggestions please.

Thanks.
Jul 17 '05 #1
0 1136

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Pat Alessi | last post: by
1 post views Thread by Michael | last post: by
1 post views Thread by Carl B Davis | last post: by
1 post views Thread by Ersin Gençtürk | last post: by
1 post views Thread by Ike | last post: by
5 posts views Thread by zMisc | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.