Problem mit der stdClass

Deutschsprachiger Support für CMS Made Simple
Post Reply
felixg
New Member
New Member
Posts: 3
Joined: Thu Jan 31, 2008 2:28 pm

Problem mit der stdClass

Post by felixg »

Hallo erstmal,

ich versuche grade mit einem DB Inhalt einen DropDownListe zu erstellen.
Dies mache ich mit folgendem Code:

Code: Select all

$national = array();
$query = "SELECT * FROM ".cms_db_prefix()."module_wsnational ORDER BY id";
$dbresult = $db->Execute($query);




while ($dbresult && $row = $dbresult->FetchRow())   

{
  $onerow = new stdClass();
  $onerow->id = $row['id'];
  $onerow->name = $row['name'];
  print_r($onerow);
  $national[] = $onerow;
}           

      
    $this->smarty->assign('prompt_national', $this->Lang('national'));
    $this->smarty->assign('input_national',
        $this->CreateInputDropdown($id, 'input_national', 
              $national, -1, ''));
Die sollte eigentlich funktionieren. Aber es kommt folgender Fehler.

Catchable fatal error: Object of class stdClass could not be converted to string in I:\xampp\htdocs\cms\lib\classes\module_support\modform.inc.php on line 303

Ich benutzt die Black Rock Version 1.2.3.

Hoffe es kann wer helfen....

lg

felixg
cyberman

Re: Problem mit der stdClass

Post by cyberman »

Bin zwar kein Programmierer, aber sollte das nicht so aussehen ::)?

Code: Select all

    $smarty->assign('prompt_national', $this->Lang('national'));
    $smarty->assign('input_national',
        $this->CreateInputDropdown($id, 'input_national', 
              $national, -1, ''));
Last edited by cyberman on Thu Jan 31, 2008 10:46 pm, edited 1 time in total.
felixg
New Member
New Member
Posts: 3
Joined: Thu Jan 31, 2008 2:28 pm

Re: Problem mit der stdClass

Post by felixg »

Ne, daran lag es nicht...
Post Reply

Return to “German - Deutsch”