Forums
This topic is locked
How to show information based upon another table
06 Mar 2004 21:29:49 Luc GIS posted:
Hi all,My first post and as most people have done i guess....starting with a question.
What is wrong with this code, i have tried everything. <pre id=code><font face=courier size=2 id=code><?php do { ?>
<?php
mysql_select_db($database_serv, $serv);
$query_sources = "SELECT * FROM source";
$sources = mysql_query($query_sources, $serv) or die(mysql_error());
$row_sources = mysql_fetch_assoc($sources);
$totalRows_sources = mysql_num_rows($sources);
mysql_select_db($database_serv, $serv);
$query_countries = "SELECT * FROM country WHERE country_ID = ".$row_sources['country_ID']." ORDER BY country_ID ASC";
$countries = mysql_query($query_countries, $serv) or die(mysql_error());
$row_countries = mysql_fetch_assoc($countries);
$totalRows_countries = mysql_num_rows($countries);
?>
<tr>
<td width="15"> </td>
<td class="title_family" width="10"> </td>
<td class="title_species"><?php echo $row_countries['country_GB']; ?></td>
<td class="title_family" width="10"> </td>
<td width="15"> </td>
</tr>
<?php } while ($row_countries = mysql_fetch_assoc($countries)); ?>
</table>
<br>
</body>
</html>
<?php
mysql_free_result($countries);
mysql_free_result($sources);
?> </font id=code></pre id=code>
Thanks in advance.
Kind regards
Edited by - Luc_GIS on 06 Mar 2004 21:38:46
Replies
Replied 10 Mar 2004 03:04:33
10 Mar 2004 03:04:33 Phil Shevlin replied:
Not sure what you are trying to do, but your repeat region is repeating the whole page not the row. You also have a RS (Sources) that isn't needed for anything. I also do not see what this has to do with your post title?
WHat are you trying to do?
WHat are you trying to do?