![]() |
(beginner) database query in dropdownlist in form - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: (beginner) database query in dropdownlist in form (/showthread.php?tid=24026) |
(beginner) database query in dropdownlist in form - El Forum - 10-28-2009 [eluser]rijobo[/eluser] Hello, I would like to create a dropdown list from my database, but i get the error: A PHP Error was encountered Severity: Notice Message: Undefined variable: soort Filename: views/product_toevoegen.php Line Number: 54 What do I do wrong? This is what I do: In my controller: Code: $soort = $this->Productupload->SelectieSoort(); My model: Code: function SelectieSoort(){ My view (form): Code: <h5>Soortlijst</h5> (beginner) database query in dropdownlist in form - El Forum - 10-28-2009 [eluser]Kyle Wiebers[/eluser] In your controller try this - Code: $data['soort]' = $this->Productupload->SelectieSoort(); Ensure that you also load all the proper CodeIgniter resources in either the autoload.php file or in your Controller. (beginner) database query in dropdownlist in form - El Forum - 10-28-2009 [eluser]rijobo[/eluser] I've tried this, but I've still got the same error unfortunately. (beginner) database query in dropdownlist in form - El Forum - 10-28-2009 [eluser]bgreene[/eluser] $data['soort]' = $this->Productupload->SelectieSoort(); $this->load->view('product_toevoegen', $data); (beginner) database query in dropdownlist in form - El Forum - 10-28-2009 [eluser]rijobo[/eluser] Now I don't get the error anymore, but I do get some unexpected results. Is my model and view still ok? (beginner) database query in dropdownlist in form - El Forum - 10-28-2009 [eluser]bgreene[/eluser] mea culpa $data[‘soort’] = $this->Productupload->SelectieSoort(); $this->load->view(‘product_toevoegen’, $data); |