• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parse error: syntax error, unexpected $end caused by foreach in view

#11
[eluser]InsiteFX[/eluser]
Create a new method and pass in the users id and fetch the data like the one above.

Code:
function get_user($id = '')
   {
    $this->db->where('id', $id);  // get users record
    $q = $this->db->get('membership');   // this would be changed to your users table name

    if($q->num_rows() > 0) {
      // return a single db row array $row['name'];
      return $q->row_array();
      // return a single db object $row->name;
      // return $q->row;      
     }
     return FALSE;
  }
}

Or if your seesion already contains the users id pass that in to the new method.

I wish you were home so that we could work together like before lol.

You need to show your profile table so that we can see what needs to be done...

#12
[eluser]swgj19[/eluser]
I was thinking something with the id. I know how to do this in procedural php, but am now learning all this stuff with the mvc. I think from here now it is smooth sailing.

Ray, I am working on a cool website. It will take some time, but I am working on it as I have the time. I will be on skype tonight after midnight my time if you want to chat about it. I will probably get off work at 12:40am tonight. When I go to the computer lab, I will have a good internet connection. I will bring my headset and also be able to do Team Viewer 7.

Thanks for the help again. Once I get good enough, I can start helping you with building your tutorials for your site. I can at least do the basic tutorials I think..

#13
[eluser]InsiteFX[/eluser]
Add a user_id to your profile table and make it a key

Then you can grab the users profile by their user id.

So when you create the users profile assign the users id to the profile users id.

#14
[eluser]InsiteFX[/eluser]
I forget now what was our time difference 2 hours I think right?

But I should be on tonight.

#15
[eluser]swgj19[/eluser]
Yeah, you are two hours ahead of my time.

#16
[eluser]InsiteFX[/eluser]
Na, the grandson went home today so I have my computer back.

#17
[eluser]swgj19[/eluser]
Nice. You might have to spend a few hours uninstalling games or software. lol

#18
[eluser]InsiteFX[/eluser]
Na, his games are alright no problems he only has two on here.

Love my new SSD hard drive thing is fasssst!

#19
[eluser]swgj19[/eluser]
See ya later..


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.