Hi all
Hello leatherback
Right, I think I am getting there. I now have 2 tables, Embass & Flags. Flags with 2 fields"id" and "country" the "id" for the "country" is the same as the "id" in the "embass" table. The script runs ansd shows that it is trying to pick up a graphic file for each row but is not showing the actual .gif file. Am I doing this correctly.
This is the code below,
$query = "Select * from flags where country=$id";
$result =@ mysql_query($query);
while ($row =@ mysql_fetch_array($result));
{
$body .=" <img src = \"row[country]\".gif>";
}
$query = "select country, embassy_name from embassies order by country LIMIT $offset,$diff";
$result = mysql_query($query) or die(mysql_error());
// Start a table, with column headers
echo "\n<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing\"2\">" .
"\n\t<td width=\"10%\" bgcolor=\"#CCCCCC\"><font color=\"black\" size=\"2\" ></td>" .
"\n\t<td width=\"20%\" bgcolor=\"#CCCCCC\"><font color=\"black\" size=\"2\" >Country</td>" .
"\n\t<td width=\"80%\" bgcolor=\"#CCCCCC\"><font color=\"black\" size=\"2\" face=\"arial\">Name</td>" .
"\n</tr>";
echo "\n<tr>\n\t<td></td>\n</tr>";
echo "\n<tr>\n\t<td></td>\n</tr>";
echo "\n<tr>\n\t<td></td>\n</tr>";
// Until there are no rows in the result set,
// fetch a row into the $row array and ...
while ($row = mysql_fetch_array($result))
{
// ... start a TABLE row ...
echo "\n<tr>";
echo "<td>". $body . "</td>";
?>
<td align="left" width="766"><font color="black\" face="arial\"size="2"> <a href=\"embassies/emb.php?idname=<? echo urlencode($row["country"]).">".$row["country"] ?></a>
</td>
<?
"\n\t";
echo "<td align=\"left\"><font color=\"black\" face=\"arial\"size=\"2\" >" .
$row["embassy_name"] .
"\n\t";
echo "</tr>";
// Finish the row
echo "\n</tr>";
}
if($zur!=TRUE)echo'<a href="'.$PHP_SELF.'?id='.($id-($tmp+$step)).'&offset='.($offset-$step) . ' "><font face=arial size=-6>Back </a> ';
for ($i=1;$i<=(int)ceil($anz/$step);$i++) echo '<font face=arial size=-6><a href="'.$PHP_SELF.'?id='.(($i-1)$step).'&offset='.(($i-1)$step). '" > '.$i.'</a> ';
if ($vor != TRUE) echo '<a href="'.$PHP_SELF.'?id='.$id.'&offset='.($offset+$step).'"><font face=arial size=-6>Next</a>';
// Then, finish the table
echo "\n</table>\n";
// Close the connection
if (!(mysql_close($connection)))
showerror();
?>
Dereck