Page 1 of 1

User-defined tag problem

Posted: Sun Jan 22, 2006 7:51 am
by kode_fi
I made user-defined tag that print's mysql status to hmtl table. Tag works OK, but table appears at the very end of the page. If I put {tag} on the beginning of the  page, it appears below the footer.

Code looks like this

Code: Select all

$host="localhost";
$user="xxx";
$password="xxx";
mysql_connect($host,$user,$password);
$sql="show status";
$result = mysql_query($sql);
if ($result == 0)
echo "<b>Error " . mysql_errno() . ": ". mysql_error() . "</b>";
else
{
echo "<table border=1>";
echo "<tr><td><b>Variable_name</b></td><td><b>Value</b></td></tr>";

for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo "<TR>";
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++) {
echo "<TD>" . $row_array[$j] . "</td>";
}
echo "</tr>";
} 
}
I've tried that tag on CMSMS versions 0.11 and 0.11.2.

Teemu Koistinen

Re: User-defined tag problem

Posted: Sun Jan 22, 2006 2:49 pm
by Ted
There is no closing tag.  Not sure if that's the problem, but it's my quick guess.