In one of my User Defined Tags I'm trying to include an external database query in order to produce a listing.
It looks like:
Code: Select all
//User Defined Tag: Listing
require ('connection.php');
$link= mysql_connect($host,$user,$password)
or die ("couldn't connect to server");
$db = mysql_select_db($database,$link)
or die ("Couldn't select database");
$query = "SELECT * FROM tbl_x LEFT JOIN tbl_y
ON a=b
ORDER BY c, d";
$result = mysql_query($query)
or die ("Couldn't execute query.");
while ($row = mysql_fetch_array($result))
{
echo "<ul>";
extract($row);
echo "
<li>
<a href='http://domain.com/blahblah.php
?page=e&f=$g'>
$c, $d </a>
</li>
</p>";
echo "</ul>";
}
mysql_close($link);string(61) "Smarty error: unable to read resource: "globalcontent:footer"" string(61) "Smarty error: unable to read resource: "globalcontent:footer""
and shows no proper footer.
Just removing the last line of the User Defined Tag
Code: Select all
mysql_close($link);