Closed jockster closed 13 years ago
Hi,
I really have no idea what's going on here - are those two bits of code inside the same file? If the top code works but the bottom code doesn't, I really don't know what the problem is. But it's definitely not Idiorm specific - it's a general problem with the structure of your code.
Hint: if the first code section is in a file called a.php
and the second code section is in a file called b.php
, then you need the following line at the top of b.php
:
require_once 'a.php';
Hi Jamie,
Really sorry for the confusion caused.
The both snippets are in the same file - the Sessions class are written just below the ORM::configure...-lines. I can't just get it to work. Obviously the idiorm.php is properly included as I can make the "ORM::for_table('sessions')->find_one($id);" line work perfectly if I move it out of my class.
Any ideas?
Thanks,
Hi Jamie, Sorry for taking your time with this. It appears that as I used the class to create my own session handler, I needed to call session_write_close(); before the end of execution, so nothing wrong with Idiorm :)
Thanks a lot for your support, again - sorry to take your time.
Great, glad you fixed it.
Jamie
Hi again Jamie,
I guess that this is a no-brainer for you, but it's starting to give me grey hairs :)
I have instantiated idiorm like in your example; ORM::configure('mysql:host=192.168.1.1;dbname=myDb'); ORM::configure('username', 'root'); ORM::configure('password', 'root');
I need to access the ORM static variable from a method inside a class, like this for instance
How should I do this the most proper way?