loop
Posted: Sat Oct 09, 2004 4:36 pm
hello i have a code ive been messing around for a bit, the code is suppose to generate a table and but the data in each one of the tebles rows as opposed to creating a new table for eack piece of data...i know it is doing this because the table is inside a loop, but there are so many it is confusing the heck out of me, so if someone could tell me the proper place to place what that would be awesome.
Here is the code:
The tables im talking about are on lines 13-15
Thanks,
Here is the code:
Code: Select all
<?php
$result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
while ($row3 = $db->sql_fetchrow($result3)) {
$m_title = stripslashes($row3['title']);
$custom_title = $row3['custom_title'];
$view = intval($row3['view']);
$m_title2 = ereg_replace("_", " ", $m_title);
if ($custom_title != "") {
$m_title2 = $custom_title;
}
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
$content .= "<table border="0" width="100%">";
$content .= "<tr><td background="themes/OrangeT3mplate/images/button.jpg" height="10"><big>·</big></strong> <a href="modules.php?name=$m_title">$m_title2</a></td></tr>\n";
$content .= "</table>";
}
}
}
?>Thanks,