User-defined tag problem

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
kode_fi
Forum Members
Forum Members
Posts: 21
Joined: Mon Oct 17, 2005 7:13 am

User-defined tag problem

Post 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
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: User-defined tag problem

Post by Ted »

There is no closing tag.  Not sure if that's the problem, but it's my quick guess.
Post Reply

Return to “Developers Discussion”