Jumi Blank

A multipurpose module, plugin and component

Jumi Blank

New postby shavertech » Tue Oct 18, 2011 11:47 am

Hi,

trying to write a simple page to display database records, I get a blank page. No errors, but nothing showing either. Can I use the joomla api?

Code: Select all
<?php
      $db =& JFactory::getDBO();
      $db->setQuery("SELECT * FROM ws_contacts WHERE juserid = '42' LIMIT 0 , 30");
      $rL =& $db->loadObjectList();
      if (empty($rL)) {
          $jAp->enqueueMessage($db->getErrorMsg(), 'error');
          return;
      } else {
          $db->setQuery("SELECT count(*) FROM ws_contacts where juserid = '42");
          jimport('joomla.html.pagination');
          $pageNav = new JPagination($db->loadResult(), '0','10');
          $color1 = "sectiontableentry1";
          $color2 = "sectiontableentry2";
        echo "<h3>Contacts</h3>";
          echo "<table width=\"100%\"><tr class=\"sectiontableheader\"><td>#</td><td>Name</td><td>Company</td><td>Email</td></tr>\n";
          $i = '0';
          foreach ($rL as $row) {
        $i++;
              $rcolor = ($i % 2) ? $color1 : $color2;
              echo "<tr class=\"{$rcolor}\"><td>{$i}</td><td>{$row->name}</td><td>{$row->company}</td><td>{$row->email}</td></tr>\n";
          }
          echo "</table>";
          echo $pageNav->getPagesLinks();
      }
?>
shavertech
 
Posts: 41
Joined: Tue Oct 18, 2011 11:41 am

Re: Jumi Blank

New postby shavertech » Wed Oct 19, 2011 3:08 am

Interestingly, this works perfectly well as an included file.

Oh well, I guess that "fixes" it.
shavertech
 
Posts: 41
Joined: Tue Oct 18, 2011 11:41 am


Return to Jumi

Who is online

Users browsing this forum: No registered users and 1 guest

cron