Welcome Guest, Not a member yet? Register   Sign In
Using Former functionality with new project
#11

[eluser]CroNiX[/eluser]
There's nothing wrong with if statements to help build a query. Let's see what you have tried that doesn't work in the 2 days you have been working on this. If you are just waiting for someone to do it for you, you might have better luck posting in the jobs forum. It looks like about .5 hours worth of work.
#12

[eluser]xtremer360[/eluser]
So far I have created these two functions:

Code:
/**
     * Get roster list
     *
     * @return object/NULL
     */
    function getRosterList()
    {
        $this->db->from('rosterList');
        $query = $this->db->get();
        if ($query->num_rows() > 0)
        {
            return $query->result();
        }
        return null;
    }
    
    /**
     * Get list of roster by user ID
     *
     * @return object/NULL
     */
    function getRosterByUserID()
    {
        $this->db->from('rosterList');
        $this->db->where('userID', $userID);
        $query = $this->db->get();
        if ($query->num_rows() > 0)
        {
            return $query->result();
        }
        return null;
    }

But there's still like 5 different queries inside the old code.
#13

[eluser]xtremer360[/eluser]
For the controller I have $data[rosterList] = $this->kowauth->getCharacterList();

kowauth is my library. So here's the part that's getting me is inside the library. I'm not sure of the functionality I need.
#14

[eluser]xtremer360[/eluser]
I'm trying to figure out if I need to do just a query just to find the total number of characters. There's just so many and trying to limit the code to only whats really needed.
#15

[eluser]xtremer360[/eluser]
Any other ideas?
#16

[eluser]xtremer360[/eluser]
*bump*
#17

[eluser]xtremer360[/eluser]
Bump
#18

[eluser]xtremer360[/eluser]
Anybody?
#19

[eluser]xtremer360[/eluser]
Any thoughts?
#20

[eluser]aquary[/eluser]
Please try to remap your thought again. If you have 7 query which are doing different task, so be it, create 7 methods for each of them. As long as you don't have something like function A do "a" purpose, then function B do "a" purpose with a little twist inside, it's ok.

If you keep asking like this without any futther try coding & experimenting by yourself, you cannot improve. It's better to catch the concept and notice what is good & not good by your own hands. We could give you a good practice, but cannot help with "I want to do this, I haven't try it yet. please help"




Theme © iAndrew 2016 - Forum software by © MyBB