Sapient
07-10-2007, 06:01 PM
I would like each field in a table (generated from an Oracle database) to be a link to a different page. For example, all rows in field one would link to "linkone.php", all rows from field 2 would link to "linktwo.php, and all rows from field three would link to "linkthree.php".
I think the best way to do this is to use a $VARIABLE, based on $i as in the code below. But I can't figure out the syntax for placing a variable in my href.
// Read fetched data.
while (oci_fetch($s))
{
// Print open and close HTML row tags and columns data.
print '<tr>';
for ($i = 1;$i <= oci_num_fields($s);$i++)
print '<td class="v"><a href=\'$VARIABLE.php?dataset='.oci_result($s,$i).'\'>'.oci_result($s,$i).'</td>';
print '</tr>';
}
Any help would be greatly appreciated.
I think the best way to do this is to use a $VARIABLE, based on $i as in the code below. But I can't figure out the syntax for placing a variable in my href.
// Read fetched data.
while (oci_fetch($s))
{
// Print open and close HTML row tags and columns data.
print '<tr>';
for ($i = 1;$i <= oci_num_fields($s);$i++)
print '<td class="v"><a href=\'$VARIABLE.php?dataset='.oci_result($s,$i).'\'>'.oci_result($s,$i).'</td>';
print '</tr>';
}
Any help would be greatly appreciated.