Welcome Guest, Not a member yet? Register   Sign In
Using the Active Record library as a standalone
#11

[eluser]oddman[/eluser]
np mate, thanks Popcorn for providing some examples Smile
#12

[eluser]Frunkie[/eluser]
[quote author="oddman" date="1230969879"]np mate, thanks Popcorn for providing some examples Smile[/quote]
Absolutely.. All you guys have given great help!

I just managed to get my first result set back out of CI's database library. It looks like I may have been successful at extracting it after all. Smile

I'll post back when I am positive that I have it working 100%.
#13

[eluser]Colin Williams[/eluser]
Code:
$db =& DB();
$db->query();

And not:

Code:
$db = new CI_DB();
$db->query();

DB() is the function that will give you an instance of the class.
#14

[eluser]Frunkie[/eluser]
[quote author="Colin Williams" date="1230974724"]
Code:
$db =& DB();
$db->query();

And not:

Code:
$db = new CI_DB();
$db->query();

DB() is the function that will give you an instance of the class.[/quote]

Hey Colin, thanks. I tried but it is still giving me the same error which is:

"Class 'CI_DB' not found"

Any ideas? I'd really like to use this lib if I can. Besides, it has now become an obsession. Smile
#15

[eluser]Frunkie[/eluser]
Colin,

You were right. I got it working. What I needed to do was instantiate the class outside of the DB.php file. I originally started off that way and then moved everything into the DB.php file to troubleshoot. I honestly have no idea what was different from then till now but I'm content. Smile

Thanks guys!
#16

[eluser]Christophe Sautot[/eluser]
Here are 2 stand-alone variations of CI's active record library that I have found:

http://blog.documentopia.com/?p=16

http://github.com/itspriddle/codeigniter-database-library/

These can be useful if you are supporting an old project that wasn't built on CodeIgniter and that just needs a better way to handle database interactions.
#17

[eluser]Darkroom Dave[/eluser]
I updated my version of the standalone library to 2.1.0

https://github.com/DevelopmentDocumentop...-Record-CI

It is pretty easy to do with the latest CI but this might give somebody a leg up.
#18

[eluser]zend[/eluser]
ERROR:


Notice: Use of undefined constant BASEPATH - assumed 'BASEPATH' in C:\xampp\htdocs\my_DB\active_init.php on line 27
Database Driver Class Initialized
Warning: Creating default object from empty value in C:\xampp\htdocs\my_DB\active_init.php on line 33

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\my_DB\database\DB_forge.php on line 41
Database Forge Class Initialized
Fatal error: Call to a member function result_array() on a non-object in C:\xampp\htdocs\my_DB\active_init.php on line 71




Theme © iAndrew 2016 - Forum software by © MyBB