relentless123 - 2011-10-01

Hi,

I'm adding multiple list support for my users. So far I've:

  • Added a new service called "List"
  • Created a new table and associated fields
  • Added function to name a new list and add it to the db

I'd like some help on returning the values of the new db to populate a combo
box on a form I've built. Here is the (wrong) code I have so far in my
"list.php" file

    /**
    * Returns the user custom list names
    */

    public function returnList($listId, $sId = null) {
        if ($sId === null) {
            $userservice = SemanticScuttle_Service_Factory::get('User');
            $sId = $userservice->getCurrentUserId();
        }
        $sql = 'SELECT * FROM '. $this->getTableName()
            . ' WHERE uId ='
            . ' "' . $this->db->sql_escape($sId) .'"';

        $result = mysql_query($sql);     
        while ($row = mysql_fetch_array($result)) {
            $listName = $row["listName"];
            $options.="<OPTION VALUE='$listName'>";
            } 
            return $options;
        }

I want to call this function and return the results in a combo box on
editbookmark.tpl.php, how would I do that?

Thanks for the help!!!