Custom install/uninstall PHP and SQL files for Plugins?

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
User avatar
james011
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Fri Sep 11, 2009 1:51 pm
Location: North East Pennsylvania
Contact:

Custom install/uninstall PHP and SQL files for Plugins?

Post by james011 » Wed Aug 29, 2012 9:12 pm

I know that you can have custom install/uninstall php and sql files for components. Can you also do this for plugins?

grayz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 128
Joined: Tue Dec 12, 2006 8:37 pm

Re: Custom install/uninstall PHP and SQL files for Plugins?

Post by grayz » Sun Sep 23, 2012 9:29 pm

This is not a typical job for plugin - changing database content.
However, it's very easy to achieve by using

Code: Select all

 $database =& JFactory::getDBO();
 $query = "CREATE TABLE IF NOT EXISTS `example` ( `id` INT, `data` VARCHAR(100) );"
 $database->setQuery($query);
 $result = $database->query();;
But I don't know a way to delete the table when uninstalling plugin/module!
www.justPHP.net - HACKS for Hot Property, Custom 404 Error Pages, Templates for Joomla etc.
Developing: www.zerno.org.ua


Locked

Return to “Joomla! 1.5 Coding”