[eluser]Dam1an[/eluser]
Welcome to CI
Just a few comments (I'll try not to repeat what has already been said too much)
You seem to load the URL helper in each controller method, so you could move that load into the constructor (although you could move all of them there, or have the common stuff in a seperate function as Joost said)
The getNumStudents method seems redundant... Its the same effect as calling sizeof on the strudents you've already got at that point
Instead of using uri->segment(3), I would pass it in as a parameter to the function (segments 3+ become parameters)
In your getStudentsWhere function you don't have a check before returning the results, this can cause problems if there are no matches, I always do
Code:
return $query->num_rows() > 0 ? $query->result() : false;
This appears to be a common thing by people on these forums
As has been said, I would put some checks in place on the delete function
Also maybe set a default limit (as a parameter) of 1
In your view, the delete seems to be broken
Code:
// Yours
<a href="<?=site_url(">Delete</a>
// I recommend
<?=anchor('students/delete/'.$user['id'], 'Delete')?> // Notice that the user id will become the parameter
Thats it for now
Wait, one more thing, I know you said you need to style your view, but your table headings are wrong
Code:
// Yours
<table class="studentlist">
<tr>
<td><h4>ID</h4></td>
<td><h4>Student Name</h4></td>
</tr>
// Mine, using table headings instead of table data with heading tags thrown in
<table class="studentlist">
<tr>
<th>ID</th>
<th>Student Name</th>
</tr>
You can then style them as you want in the CSS (just makes it a little cleaner, and valid)