there are two tables in my database that i'm querying (in_news and obj)
they both have a common field (obj_id)
i'm querying the in_news table for the in_news_id, in_news_date, obj_id
I'm querying the obj table for the obj_location
what's wrong with my code?
the $obj_location is not displaying any query results.
thanks in advance for any help,
Jon
<div id="news">
<h4>Latest News (<a href="news.php">all</a>)</h4>
<table border="0" cellspacing="0" cellpadding="0">
<?php
$query = "select in_news_id, in_news_date, obj_id, summary from in_news order by in_news_date desc limit 3";
$result = mysql_query($query);
$date_formatter = new DateFormatter;
while ($myrow = mysql_fetch_array($result)) {
$in_news_id = $myrow["in_news_id"];
$in_news_date = $date_formatter->fixSqlDate($myrow["in_news_date"]);
$summary = $myrow["summary"];
$obj_id = $myrow["obj_id"];
$query2 = "select obj_location from obj where obj_id=$obj_id";
$result2 = mysql_query($query2);
$obj_location = $myrow["obj_location"];
?>
<tr class="date">
<td><?= $in_news_date;?></td>
</tr>
<tr class="title">
<td><a href="/assets/<?=$obj_location;?>"><?= $summary;?></a></td>
</tr>
<?
}
?>
</table>
</div>