having trouble looping through query results |
[eluser]jvittetoe[/eluser]
Hello, in my application, once a user logs in they are directed to their dashboard controller... Code: <?php from here i am loading the model, and running the function qryOverview which queries the db for all user items associated with the user. here is the qry. Code: function qryOverview(){
[eluser]coolfactor[/eluser]
You weren't storing the returned query into the $query variable. You need something like this: Quote:$query = $this->userItems->qryOverview();
[eluser]jvittetoe[/eluser]
ah, thanks. now ive got my code looking like this... Code: function index(){ then in dspDashboard view file, Code: <?php this is resulting in a white blank page...
[eluser]Nillian[/eluser]
Remove the $data['query'] in your view file and use simply $query. CI converts the array into individual variables for you to use in your view file
[eluser]jvittetoe[/eluser]
so the variable $query will be automaically passsed to the view file? then would i run that loop in my view file? im getting a white page when i do that.
[eluser]coolfactor[/eluser]
He means to do this: Code: foreach ($query->result_array() as $row){
[eluser]Nillian[/eluser]
Try this thread: http://ellislab.com/forums/viewthread/59674/ Or this one: http://ellislab.com/forums/viewthread/56059/ They might not help, but I hope they do |
Welcome Guest, Not a member yet? Register Sign In |