![]() |
Assigning Query (Read) Results to Variables - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Assigning Query (Read) Results to Variables (/showthread.php?tid=48688) Pages:
1
2
|
Assigning Query (Read) Results to Variables - El Forum - 01-26-2012 [eluser]nydeveloper[/eluser] Is there something additional that needs to be done to make these variables available to other functions within the same model? I tried the following, but received an undefined variable error: Code: function variable_test() Assigning Query (Read) Results to Variables - El Forum - 01-26-2012 [eluser]Bhashkar Yadav[/eluser] try like this Code: class Simple_model extends CI_Model hope this would help you. Assigning Query (Read) Results to Variables - El Forum - 01-29-2012 [eluser]nydeveloper[/eluser] Quote:try like this I've tried a few variations of the above, but am having no luck. The variable(s) in question are still not being recognized by any functions other than the one which extracts data from the array and assigns it to the respective variable(s). I still receive the 'undefined variable' error each time when trying to use them in another function within the same model. Does anyone have any other suggestions on how I can achieve this? Thanks. Assigning Query (Read) Results to Variables - El Forum - 01-29-2012 [eluser]CroNiX[/eluser] I think you need to learn more basic PHP before trying to get into OOP or CodeIgniter. Not trying to be mean, but this is basic PHP stuff. Assigning Query (Read) Results to Variables - El Forum - 01-30-2012 [eluser]InsiteFX[/eluser] You state that the variables in question are not being recognized but you do not show the code here that is giving you the problem! Show the code with the problem... |