database for plugin

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

database for plugin

Post by oxygenws » Fri Jan 21, 2005 7:34 pm

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

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: database for plugin

Post by garvinhicking » Sat Jan 22, 2005 12:58 pm

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 12:20 pm
Location: Iran
Contact:

Post by oxygenws » Sat Jan 22, 2005 1:18 pm

Thanks Garvin :)

Post Reply