We help IT Professionals succeed at work.
Get Started

retrieve data (query) problem smarty

Mutsop asked
Last Modified: 2013-12-12

I recently installed 'collabtive' (project management script in some sort of mvc with smarty engine).
Although it is my first time using the smarty engine I kind of managed to retrieve some data from my database.

One problem though:
I only get the amount of data from the database but with no text or what so ever.
To be more exact, I have 7 rows in mysql, and also get them on my page, but they are just empty rows.

The code itself is kind of long, but I still hope you guys could help me.

EDIT: don't mind the tools column, I still have to fix that


function getportfolio($id)
        $id = (int) $id;

        $sel = mysql_query("SELECT * FROM portfolio WHERE ID = $id LIMIT 1");
      $portfolio = mysql_fetch_array($sel,MYSQL_ASSOC);
        if (!empty($portfolio))
         $portfolio["id"] = stripslashes($portfolio["id"]);
         $portfolio["name"] = stripslashes($portfolio["name"]);
            $portfolio["description"] = stripslashes($portfolio["description"]);
            return $portfolio;
            return false;
    function getportfolios()
        $category = mysql_real_escape_string($category);

        $portfolios = array();
        $sel1 = mysql_query("SELECT id, name, description FROM portfolio");

        while ($portfolio = mysql_fetch_array($sel1))
            $theportfolio = $this->getportfolio($portfolio["ID"]);
            array_push($portfolios, $theportfolio);

        if (!empty($portfolios))
            return $portfolios;
            return false;


$portfolio = new webportfolio();
$listportfolio = $portfolio->getportfolios($id);
if ($action == "config")
   $title = $langfile['configwebsite'];
   $template->assign("title", $title);
} elseif ($action == "portfolio")
      $title = $langfile['addportfolio'];
      $template->assign("title", $title);
      $template->assign("getlistportfolio", $listportfolio);


<div class="block" id="website" style = "{$websitestyle}">
            <table cellpadding="0" cellspacing="0" border="0">

                     <th class="a"></th>
                     <th class="b">{#title#}</th>
                     <th class="c">{#description#}</th>
                     <th class="tools"></th>

                     <td colspan="4"></td>

               {section name=portfolio loop=$getlistportfolio}

               {if $smarty.section.portfolio.index % 2 == 0}
               <tbody class="color-a" id="proj_{$getlistportfolio[portfolio].id}">
               <tbody class="color-b" id="proj_{$getlistportfolio[portfolio].id}">
                     <td class="tools">
                          {if $userpermissions.projects.edit}
                        <a class="tool_edit" href="manageproject.php?action=editform&amp;id={$getlistportfolio[portfolio].id}" title="{#edit#}" ></a>{/if}
                        {if $userpermissions.projects.del}
                        <a class="tool_del" href="javascript:confirmfunction('{#confirmdel#}','deleteElement(\'proj_{$getlistportfolio[portfolio].id}\',\'manageproject.php?action=del&amp;id={$getlistportfolio[portfolio].id}\')');"  title="{#delete#}"></a>

                  <tr class="acc">
                     <td colspan="5">
                        <div class="accordion_toggle"></div>
                        <div class="accordion_content">
                           <div class="acc-in">
                              <div class="message-in">


            <div class="tablemenue"></div>

      </div> {*block END*}

Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE