Function Not Returning Result to Another |
[eluser]kingnutter[/eluser]
The following section of my model shows where I would like function GetLinks to call a result from the previous function, getInstanceRef. The view gives Error Number: 1054 -Unknown column 'Array' in 'where clause' (SELECT * FROM (`links`) WHERE `instance_id` = Array) I've seen this in regular PHP but not sure how to sort it in an MVC setup. Any tips would be very appreciated. Code: function getInstanceRef()
[eluser]John_Betong_002[/eluser]
Try this: Code: //=================================
[eluser]kingnutter[/eluser]
Thank you very much for this. I'm fairly new to CI so I hope you don't mind me asking a couple of questions about your code. I haven't come across the word "private" before a function. Why is that used before $result_to_be_passed. Is $this->result_to_be_passed in getInstanceRef just calling a variable? Why use "$this"->? What should I putting in the place of "__METHOD__"? Basically I'm just trying to understand what these three stages are doing. Sorry if it is all really obvious but it would really help me understand the process. Thanks again.
[eluser]John_Betong_002[/eluser]
[quote author="kingnutter" date="1309213273"]Thank you very much for this. I'm fairly new to CI so I hope you don't mind me asking a couple of questions about your code. I haven't come across the word "private" before a function. Why is that used before $result_to_be_passed. Is $this->result_to_be_passed in getInstanceRef just calling a variable? Why use "$this"->? What should I putting in the place of "__METHOD__"? Basically I'm just trying to understand what these three stages are doing. Sorry if it is all really obvious but it would really help me understand the process. Thanks again.[/quote] http://www.php.net/manual/en/language.oo...bility.php With your code try this: Code: // correct |
Welcome Guest, Not a member yet? Register Sign In |