Noob question. - 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: Noob question. (/showthread.php?tid=26166) |
Noob question. - El Forum - 01-07-2010 [eluser]jav99[/eluser] hi, am pretty new to code igniter, but am pretty excited bcz it's potential, am trying to make a simple and i would like to see if someone could give me pointers, i want the CI to take the query, and print for each 4 of the results example query result, let's say this is the ID row, the results would go from 1 to 0L 1,2,3,4,5,6,7,8,9,0 then am wondering how could i print the results in a group containing results from 1 - 4, then start the loop again but containing the results from 5 - 0 and so on. Sorry for the nub questions, but any help will be much appreciated... Noob question. - El Forum - 01-07-2010 [eluser]stuffradio[/eluser] Something like this Code: //yourcontroller.php Code: //yourmodel Code: //myview.php Your question isn't 100% clear on how you want the results to be displayed, but pretty much this gets every row in the table from the model, and every 4 rows it will enter a line break. This is just an example and I hope I did wrote something that will help you Noob question. - El Forum - 01-07-2010 [eluser]jav99[/eluser] OMG THAT WAS FAST!! HAHA, and a slap to the face of pure goodness! thanks man, well the way i was trying to get it to show was in groups, bcz am using a sort of glider to partially show the results, using as an example the days of the week contained in a table. say it prints groups of 3 days like: --- css div----- monday (id = 1) tuesday (id = 2) wednesday (id = 3) ----- then the loop breaks, and closes the divs and ask if there are more days (this one is easy) if there are open another div and print-- Thursday (id = 4) friday (id = 5) saturday (id = 6) ----- then the loop breaks, and closes the divs again Man , thanks for your help, u have been very helpful so far, am just skimming the surface of code igniter, but am getting very excited!!! Noob question. - El Forum - 01-07-2010 [eluser]stuffradio[/eluser] Glad to help and glad you're excited Noob question. - El Forum - 01-08-2010 [eluser]huzzi[/eluser] Next time try to put a relevant thread title and you'd get even faster response |