Here are 2 scripts i have ... the first links to the second. My problem is the link in the first table for the Agency does not link properly. i believe it has something to do with the fact that i am using myrow[5] twice in the second script and so it states that it cant jump to row 0. i found that when i changed the agency_name='$myrow[5]' to the actual name of the agency replacing the $myrow[5] it works just fine. so this is why i think that the use of $myrow[5] is causeing the error, but i dont know how or to what to change it, for the link to work properly. if you understand my problem please help.
<body>
<?php
$db = pg_connect("","","","","funds");
$query = "SELECT * FROM scholarship where schol_id=$schol_id";
$result = pg_exec($db, $query);
if (!$result) {printf ("ERROR"); exit;}
$numrows = pg_numrows($result);
$row=0;
do
{printf ("<table border=1>\n");
$myrow = pg_fetch_row ($result,$row);
$agency = $myrow[5];
printf ("
<tr><td width=130 bgcolor=\"#dfdfdf\"><b>Name :</b></td><td width=400>%s</td></tr>
<tr><td width=130 bgcolor=\"#dfdfdf\"><b>Value :</b></td><td width=400>%s</td></tr>
<tr><td width=130 bgcolor=\"#dfdfdf\"><b>Deadline :</b></td><td width=400>%s</td></tr>
<tr><td width=130 bgcolor=\"#dfdfdf\"><b>Application Information :</b></td><td width=400>%s</td></tr>
<tr><td width=130 bgcolor=\"#dfdfdf\"><b>Agency :</b></td><td width=400><a href=\"agencyview2.php?agency_name=".$myrow[5]."\">%s</a></td></tr>
<tr><td width=130 bgcolor=\"#dfdfdf\"><b>Field of Study :</b></td><td width=400>%s</td></tr>
<tr><td width=130 bgcolor=\"#dfdfdf\"><b>Level :</b></td><td width=400>%s</td></tr>
<tr><td width=130 bgcolor=\"#dfdfdf\"><b>Gender :</b></td><td width=400>%s</td></tr>
<tr><td width=130 bgcolor=\"#dfdfdf\"><b>Eligibility :</b></td><td width=400>%s</td></tr>\n",
$myrow[1], $myrow[2], $myrow[3], $myrow[4], $myrow[5], $myrow[6],
$myrow[7], $myrow[8], $myrow[9]);
$row++;
}
while ($row < $numrows);
printf ("</table>\n");
pg_close($db);
?>
</body>
agencyview2.php
<body>
<?php
$db = pg_connect("","","","","funds");
$query = "SELECT * FROM agency where agency_name='$myrow[5]'";
$result = pg_exec($db, $query);
if (!$result) {printf ("ERROR"); exit;}
$numrows = pg_numrows($result);
$row=0;
do
{printf ("<table border=1>\n");
$myrow = pg_fetch_row ($result,$row);
printf ("
<tr><td width=\"130\" bgcolor=\"#dfdfdf\"><b>Agency :</b></td><td width=\"400\">%s</td></tr>
<tr><td width=\"130\" bgcolor=\"#dfdfdf\"><b>Street :</b></td><td width=\"400\">%s</td></tr>
<tr><td width=\"130\" bgcolor=\"#dfdfdf\"><b>City :</b></td><td width=\"400\">%s</td></tr>
<tr><td width=\"130\" bgcolor=\"#dfdfdf\"><b>Province/State :</b></td><td width=\"400\">%s</td></tr>
<tr><td width=\"130\" bgcolor=\"#dfdfdf\"><b>Country :</b></td><td width=\"400\">%s</td></tr>
<tr><td width=\"130\" bgcolor=\"#dfdfdf\"><b>Postal/Zip Code :</b></td><td width=\"400\">%s</td></tr>
<tr><td width=\"130\" bgcolor=\"#dfdfdf\"><b>Phone Contact(s) :</b></td><td width=\"400\">%s</td></tr>
<tr><td width=\"130\" bgcolor=\"#dfdfdf\"><b>E-mail :</b></td><td width=\"400\">%s</td></tr>
<tr><td width=\"130\" bgcolor=\"#dfdfdf\"><b>Web Address :</b></td><td width=\"400\"><a href=\"$myrow[9]\">%s</a></td></tr>\n",
$myrow[1], $myrow[2], $myrow[3], $myrow[4], $myrow[5], $myrow[6], $myrow[7],
$myrow[8], $myrow[9]);
$row++;
}
while ($row < $numrows);
printf ("</table>\n");
pg_close($db);
?>
</body>