Topic: [Release] Database Management Plugin

This plugin is still under development so i recommend you use it carefully wink

Basically the main features are:
? Backup Forum
? Restore Backup
? Run SQL queries (this is rather experimental and I intend to improve it)
? Repair/Optimize all tables

If you have any problems, comments, suggestions please tell me wink

Download

Update 2005/02/06:
New version 1.2 for download
Mysqli support
load of little tweaks on the query output - thanks smartys

Update 2005/01/22:
New version 1.1 for download
Improved additional tables
Improved query box

Re: [Release] Database Management Plugin

I was wondering if someone would make this plugin, thanks a lot, makes things a lot easier when it comes to backing up the forum. I've tested optimize tables (it said it worked, but I didn't do db checks to see if this was the case).

I've also created a backup (using gzip compression), made a post and restored via the back up to see if it works, and it does. I don't know if I should try deleting my db and trying to restore via the backup from that or if I should wait until a problem arises that I need to use it though. wink

Anyway, thanks for the plugin, very helpful. smile

Re: [Release] Database Management Plugin

don't work for me sad sniff

Lets you perform lots of useful (and not so useful) db fuctions big_smile.

Sorry your database type is not yet supported sad

my server

mysql 4.1.8 (mysqli)
php 5.0.3
apache 1

and don't work :S

El Mejor Lugar de la Red - Corporación Azakur4

Re: [Release] Database Management Plugin

will it use alll tables in the database with the $db->prefix ?

5 (edited by Connorhd 2005-01-22 11:15)

Re: [Release] Database Management Plugin

Talikar wrote:

I don't know if I should try deleting my db and trying to restore via the backup from that or if I should wait until a problem arises that I need to use it though.

if you delete your database you won't be able to get into punbb to restore the backup, you would need to restore it from phpmyadmin or something similar

Azakur4 wrote:

don't work for me sad sniff

yeh i haven't added mysqli, or postgresql yet, mysqli shouldn't be too hard though wink

Frank H wrote:

will it use alll tables in the database with the $db->prefix ?

no the backup only backs up the default PunBB tables plus ones you specify
edit: the optimize and repair affects all tables in the db, i suppose i could make them and the backup include all tables with the right prefix wink
edit: thinking again i dunno what that would do if there was no prefix...

Re: [Release] Database Management Plugin

hmm.. I see the problem ... but if ppl can select what other tables they want, then I suppose it will work fine with the attachment mod smile

going to take a look on it when I'm done on my mod (it kind of takes up most of my free time wink)

Re: [Release] Database Management Plugin

i might add include all tables with the punbb prefix with a warning about what will happen if you have no prefix

Re: [Release] Database Management Plugin

ok i'm still testing but i've improved the additional tables bit alot, now what it does is:
1. No db prefix - will list up to 15 tables otherwise it shows the text box for additional tables
2. db prefix - lists the tables as checkboxes but cuts off after 15 tables, i'm just looking at this i might make it display the tex box for over 15 if it can be done easily

also the sql query box will hopefully do any query now wink i'll try to upload the new one tonight

Re: [Release] Database Management Plugin

a multiple select list perhaps?
Then I suppose all tables can be showed, and that the default punbb tables are pre-selected?

10 (edited by Smartys 2005-01-22 20:35)

Re: [Release] Database Management Plugin

Some ideas for the SQL query thing:
- If you run a select and it returns no data, return a "No data found" message.
- Center the returned values


A bug:

SELECT * FROM #__online;
update #__online set user_id=user_id;

This returns the select and then, at the bottom, gives the queries that have been run (both).

update #__online set user_id=user_id;
SELECT * FROM #__online;

This only returns the select, it doesn't list the queries done.


And something that should be clarified:

SELECT * FROM #__online where user_id = 3

entered works fine

SELECT * FROM #__online where user_id = 3
SELECT * FROM #__online where user_id = 3

gives SQL Error

SELECT * FROM #__online where user_id = 3;SELECT * FROM #__online where user_id = 3;

Executes both queries.

You should mention that if you want to run multiple queries you need to add a ; to the end of each query

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: [Release] Database Management Plugin

damnit you just edited it while i was repling tongue

Re: [Release] Database Management Plugin

Frank H wrote:

a multiple select list perhaps?
Then I suppose all tables can be showed, and that the default punbb tables are pre-selected?

i think i'll leave it how it is, it will now backup punbb and in alot of cases allow you to backup mods by simply ticking boxes, if you want more then theres phpmyadmin ;)

Smartys wrote:

If you run a select and it returns no data, return a "No data found" message.

done

Smartys wrote:

Center the returned values

i don't think they should be centered

Smartys wrote:
SELECT * FROM #__online;
update #__online set user_id=user_id;

This returns the select and then, at the bottom, gives the queries that have been run (both).

update #__online set user_id=user_id;
SELECT * FROM #__online;

This only returns the select, it doesn't list the queries done.

fixed added queries done to the end of all outputs

as for the multiple queries as long as you put a ; at the end of each query (except the last one which you either can or cannot it doesn't matter) it will work ;) thanks for all the input

Re: [Release] Database Management Plugin

Connorhd wrote:

as for the multiple queries as long as you put a ; at the end of each query (except the last one which you either can or cannot it doesn't matter) it will work wink

Untrue, you need a ; at the end of every query if you're running more then one or you get SQL Error

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: [Release] Database Management Plugin

thats what i said, you need a ; at the end of each query except the last one which doen't matter (i'm talking about it after the changes i've made btw)

Re: [Release] Database Management Plugin

ok you can download the new version now (v1.1) please feel free to post any problems wink

16 (edited by Smartys 2005-01-22 21:53)

Re: [Release] Database Management Plugin

Connorhd wrote:

thats what i said, you need a ; at the end of each query except the last one which doen't matter (i'm talking about it after the changes i've made btw)

Ah, yes, it works after upgrading it smile

But here's a bug:

Additional tables None detected

I have several extra tables in my database wink


Another bug: Above the first query is a Go back link, below it and above the Queries Done is a Go back link and below the Queries Done is a Go back link.

And finally:

SELECT * FROM #__online where user_id="</div>"

Even though that's a fake example (user_id is numerical) the HTML in it messes up the view of the page slightly

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: [Release] Database Management Plugin

its only for tables with the same prefix

Re: [Release] Database Management Plugin

Edited it just now tongue

Connorhd wrote:

its only for tables with the same prefix

Ah, that explains it

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: [Release] Database Management Plugin

Another bug: Above the first query is a Go back link, below it and above the Queries Done is a Go back link and below the Queries Done is a Go back link.

thats intentional theres a go back link between every query incase they get big, although i might just make it top and bottom so it looks less strange when they are small

htmlspecialchar'ed everything now tongue

Re: [Release] Database Management Plugin

Connorhd:  Great plugin.  Very useful. I like the option for backing up other tables in the db that are not part of the core app.  I found one teeny weenie error.  The word ?Optimise? is spelled Optimize.  It appears both in the submit button and the successful message.  .  Believe me, I am not spelling genius.  I just thought that since this was something many people would use that you would want to change it.  big_smile

Awesome job!

Re: [Release] Database Management Plugin

buzzkill: I do believe the Brittish English spelling is "optimise". ConnorHd is from the UK, so it makes sense smile

"Programming is like sex: one mistake and you have to support it for the rest of your life."

22 (edited by snapsolutions 2005-01-27 01:19)

Re: [Release] Database Management Plugin

Rickard wrote:

buzzkill: I do believe the Brittish English spelling is "optimise". ConnorHd is from the UK, so it makes sense smile

ahhhh thoZe people from LeedZ again wink

Great job btw! big_smile

Re: [Release] Database Management Plugin

lol, its probably spelt different all over the place, problem is a try to stick to american spelling (even though i hate them tongue) but they are used in the language... anyway maybe i'll fix tongue

24 (edited by spider8 2005-01-29 18:32)

Re: [Release] Database Management Plugin

@ Connorhd

Why do you want to stick to a dialect? English is the language, British English is the original. wink tongue

Re: [Release] Database Management Plugin

its better to use american words since thats what the actual sql command it its "OPTIMIZE" not "OPTIMISE" wink