Welcome Guest, Not a member yet? Register   Sign In
Help with array refencing database table.
#2

[eluser]kgill[/eluser]
You can do that either in the query using a join or in code. Because of the way you've structured your tables the query is going to be ugly, basically you're going to end up joining the works table to the tasks table 3 times (one for each task) which also means aliasing the tasks table to prevent ambiguous columns. To do it in code, put a 2nd function in your model for getting the tasks, fetch those into an array indexed by the task id; that way you can just dump the task out to the screen using your $list[$task_key_name], e.g. $tasks[$list[$task_key_name]].


Messages In This Thread
Help with array refencing database table. - by El Forum - 01-09-2009, 12:44 PM
Help with array refencing database table. - by El Forum - 01-09-2009, 03:25 PM
Help with array refencing database table. - by El Forum - 01-09-2009, 05:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB