database for plugin

Creating and modifying plugins.
Post Reply
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

database for plugin

Post by oxygenws »

how can i use any kind of database (database/file) for my plugin??
should/could i use add($name, $value) as my DB?!!

best regards, omid
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: database for plugin

Post by garvinhicking »

Uhm, I'm not sure if I understood you properly.

Look at the serendipity_plugin_shoutbox plugin, that is a small and easy example for a plugin creating its own database entry.

If you just want to store values, use:

Code: Select all

$this->set_config('your_config_variable', 'your value');
and later you can fetch it via:

Code: Select all

$this->get_config('your_config_variable');
But this is always stored inside DB table serendipity_config then.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

Thanks Garvin :)
Post Reply