![]() |
Trying to learn plz help.... ( getting values from database ) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Trying to learn plz help.... ( getting values from database ) (/showthread.php?tid=17672) |
Trying to learn plz help.... ( getting values from database ) - El Forum - 04-12-2009 [eluser]harry_singh[/eluser] Hi ... m new to codeigniter and php . Found codeigniter pretty interesting so got some motivation to build some application .... I have seen the video tutorials they are helpful but i m stuck. I just want to build some application having blog in it and some other features like themes and much more ( will discuss later ) so i thought of starting with making model, controller and view for categories ... Here is the model page Code: <?php this is the controller page Code: <?php Template looks like this Code: <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” I m just stuck what to do next with the view page and dont even know whether what i m doing is correct or not .... Waiting for reply :down: Trying to learn plz help.... ( getting values from database ) - El Forum - 04-12-2009 [eluser]jedd[/eluser] Hi Harry, and welcome to CI. You seem to be doing okay. Two things I'd suggest up front - show us your schema (your model makes a reference to a database column that looks a bit too verbose, even by my standards!). Secondly, your controller hasn't asked your model for any data here .. yet. EDIT: Missed the view .. flipping OSX's rapid scroll feature. Sorry. With your view, are you getting any output at all? It looks to be fine, though I tend to work with arrays over objects. Trying to learn plz help.... ( getting values from database ) - El Forum - 04-13-2009 [eluser]Thorpe Obazee[/eluser] harry_singh, have you tried phpmyadmin? Try outputting the sql query generated and paste it on phpmyadmin. See if it actually works. Trying to learn plz help.... ( getting values from database ) - El Forum - 04-13-2009 [eluser]harry_singh[/eluser] thanks for your concern Jedd and Bargainph . . . Yes i do get an output for that just trying to know what wud be the better way of doing it..... Trying to learn plz help.... ( getting values from database ) - El Forum - 04-13-2009 [eluser]Thorpe Obazee[/eluser] I thought you were having some problem when you posted this :long: [quote author="harry_singh" date="1239545170"]I have seen the video tutorials they are helpful but i m stuck.[/quote] What you're doing is correct. [quote author="harry_singh" date="1239545170"]I m just stuck what to do next with the view page and dont even know whether what i m doing is correct or not .... Waiting for reply :down:[/quote] Trying to learn plz help.... ( getting values from database ) - El Forum - 04-13-2009 [eluser]harry_singh[/eluser] Hi Bargainph, I wasnt clear for what i want to do... let me describe step by step here is my database table Code: CREATE TABLE IF NOT EXISTS `article_category` ( In the application i want categories and subcategories , and option to change the display order of the categories but thats the later part. All i want is to show only parent categories first and when clicked on it the sub categories may show up here is what m trying for my model Code: <?php as i said earlier that i dont have knowledge of php so little help wud be great and just what i shud do in the models page and controller page .... Trying to learn plz help.... ( getting values from database ) - El Forum - 04-13-2009 [eluser]Thorpe Obazee[/eluser] Try this in the Controller: Code: <?php Code: <?php Trying to learn plz help.... ( getting values from database ) - El Forum - 04-14-2009 [eluser]harry_singh[/eluser] thanks Bargainph, thats works fine , i ll continue with that and post here if any problem is there . |