It appears that my mssql query is working fine, but that I may be having problems with the array in relation to calling a specific column from a specific table.
Here's the code followed by more explanation:
Code: Select all
<?php (Database connections ommited)
mssql_select_db($database, $dbconnect);
$query = "SELECT TOP 10 Res.ResourceID, Res.Title, Res.ShortBlurb, Res.Created, Cat.Title, Doc.Title, Doc.Location ";
$query .= "FROM DA_Resource Res, DA_Category Cat, DA_Document Doc ";
$query .= "WHERE Res.ResourceID = Doc.ResourceID ";
$query .= "AND Cat.CategoryID = Res.CategoryID ";
$result = mssql_query( $query, $dbconnect );
while ($line = mssql_fetch_assoc($result))
{
$return[] = $line;
}
$output = "<html><body><ul>";
foreach ($return as $line)
{ $output .= "<li>$line[Title]</li>
<li>$line[Location]</li>";}
$output .="</ul></body></ul>";
echo $output;
?>Code: Select all
<li>$line[Res.Title]</li>Thanks.